Gen. John Allen, left, and Afghan Defense Minister Gen. Abdul Rahim Wardak clap after signing an agreement in Kabul. (Musadeq Sadeq/AP)

KABUL — The United States and Afghanistan signed a deal on night military operations on Sunday, resolving a major source of friction between President Hamid Karzai and Washington.

The agreement removes a key obstacle to a long-term strategic partnership between the two countries, including a U.S. military presence in Afghanistan after 2014, when all foreign combat troops are set to leave the country.

Karzai, who has led Afghanistan since U.S.-backed Afghan forces overthrew the Taliban in 2001, has repeatedly called for an end to the raids, calling them a clear violation of Afghan sovereignty. But U.S. military officials have long hailed the effectiveness of night operations, during which many suspected insurgents — and their commanders — have been arrested.

Under the deal, a newly formed national force — the Afghan Special Operations Unit — will have the authority to search houses and private compounds and arrest suspected insurgents, Afghanistan’s Defense Minister Abdul Rahim Wardak said Sunday. U.S. forces will provide support “only as required or requested,” according to the agreement, which was signed by Wardak and General John R. Allen, the commander of the U.S. forces in Afghanistan.

“This is ... a landmark day for the rule of law in Afghanistan,” Allen said during a signing ceremony. “This means that Afghan security forces operating under Afghan law will now be responsible for capturing and detaining the terrorists who try to kill and wound the innocent people of Afghanistan.”

Many Afghans in the south and east of the country, the main bastions of the insurgents and the focus of the night operations by U.S. and NATO forces, have repeatedly complained about the raids, charging that they violate their privacy, create panic among the population and result in civilian casualties.

The targeted operations are expected to remain a key part of military strategy through 2014 — a viable way of crippling terrorist networks, officials said, even as NATO troops continue leaving the country by the thousands. The operations will still be based on U.S. intelligence, and, for now, Afghan forces will continue to depend on U.S. airstrikes during the raids, according to the agreement.

About 3,000 night operations have been conducted during the past 14 months, with suspects apprehended 81 percent of the time, U.S. officials said last week.

Afghan officials called the agreement on night operations a significant breakthrough in relations between the two countries. The other major hurdle to a long-term strategic partnership was removed last month when U.S. and Afghan officials signed an agreement to hand over the largest U.S. military prison in the country.

Shaida Mohammad Abadali, deputy head of Afghanistan’s national security council, said by e-mail that the deal addresses “our years-long demand for full respect to Afghan sovereignty.”

“The breakthrough on this crucial matter is going to bring a new taste to our relationship,” he added.

A summit in Chicago next month between the two countries is expected to address lingering questions about the cost and size of the Afghan army and a timeline for the U.S. military to shift away from a predominantly combat role.