U.S. and Afghan officials were close Wednesday to a long-awaited agreement on controversial night operations, resolving one of President Hamid Karzai’s longest-standing grievances against the United States and attempting to dampen public resentment over the raids that Western commanders say are strategically imperative.

The compromise, which would allow Afghan soldiers to enter the homes of suspected insurgents without their American counterparts, is days from being signed, U.S. and Afghan officials said. It would remove a key obstacle to a long-term strategic partnership between the two countries, including a U.S. military presence in Afghanistan beyond 2014.

Night operations will be “fully Afghanized,” said Karzai spokesman Aimal Faizi. “The foreign troops will have a supporting role and participate only if needed.”

U.S. troops will enter targeted homes only if the situation appears particularly dire or by the request of their Afghan colleagues, officials said. In an operation in which an Afghan force is decimated, for example, U.S. troops could go beyond a “supporting role.”

Afghan officials also said they anticipated a request for U.S. assistance when the target was particularly important or if the operation was technically complex. But in most cases, they said, Afghan commandos will operate independently, although the operations will still be based largely on U.S. intelligence.

“There’s no question that for some time they’re going to need some critical support,” said one U.S. military official, referring to the sharing of intelligence, air support and logistical assistance. “But we’re expecting to see them become increasingly capable of doing this on their own.” The official spoke on the condition of anonymity to discuss sensitive issues.

Formal authorization for each raid will be issued by the Afghan government before the operation, and detainees will be sent to Afghan-run prisons, according to U.S. and Afghan officials. The question of whether the United States will retain custody of the suspects long enough to interrogate them remains unresolved, but officials from both countries said there had been progress on the issue.

‘The big parts are finished’

“Only the small parts” of the compromise are still being debated, Faizi said. After more than a year of negotiating, “the big parts are finished.”

U.S. military officials have long hailed the effectiveness of night operations, during which many top insurgents have been apprehended. Those 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. About 3,000 night operations have been conducted in the past 14 months, with suspects apprehended 81 percent of the time, U.S. officials said.

But Karzai has said that the raids are inhumane and a clear violation of Afghan sovereignty. In November, he told an assembly of influential elders that because of the operations, Afghans “fear that their doors will be knocked down at night and that they will be intimidated and harassed.”

Afghan officials described the pending agreement as 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.

“Once the agreement on night operations is signed, the two main obstacles to signing a strategic partnership before the [NATO] summit in Chicago will be removed,” said one Afghan official, also speaking on the condition of anonymity.

That summit will take place in May and is expected to answer 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.

Afghan officials said the United States has been particularly cooperative in recent weeks during a string of incidents that many thought would irreparably strain the relationship.

For their part, U.S. officials consider the new agreement “a testament to the shock absorbency of the relationship,” the U.S. military official said. “The fact that we’re negotiating underscores that Afghans appreciate the importance of these operations.”

10 killed in suicide blast

Also Wednesday, a suicide bomber targeting NATO troops killed at least 10 people in northern Afghanistan. The dead included three coalition service members, two of whom were American, officials said.

The morning incident took place in Faryab province, said the provincial governor, Abdul Haq Shafaq. A man on a motorcycle drove into a crowded part of Maimana, the provincial capital, and detonated an explosive device, he said.

Faryab’s police chief, Abdul Khaliq Aqsai, said the coalition troops were conducting interviews when the bomb went off.

Special correspondents Javed Hamdard and Sayed Salahuddin contributed to this report.