KABUL, Afghanistan (CNN) -- The United States and Afghanistan say they have reached a landmark deal to be signed Sunday that affords Afghan authorities an effective veto over controversial special operations raids.
A bid to end visceral Afghan anger over raids on private residences, the deal prevents NATO's International Security Assistance Force (ISAF) troops from conducting such operations without the explicit permission of Afghan officials, said a senior NATO official.
An Afghan review group would have to authorize an operation before it goes ahead, the official said.
Special operations forces would operate under Afghan law, said a statement from the presidential palace.
The agreement was to go into effect at a signing Sunday afternoon, said Afghan presidential spokesman Aimal Faizi. ISAF commander, Gen. John Allen, and Afghan Defense Minister Gen. Abdul Rahim Wardak were scheduled to take part in the signing.
The key deal comes after months of angry recriminations against special operations raids, particularly at night, that deeply offend Afghans as they involve foreigners entering their homes. U.S. officials say the raids are vital to NATO's operation against insurgents.
The complex system would fully "Afghanize" the operations, putting Afghan commandos in the lead and giving American special forces a "training and support role," a senior Afghan official said.
The senior Afghan official said the deal would involve a joint committee of U.S. and Afghan officials reviewing U.S. intelligence on a target before a raid.
If that target were approved, a warrant would then be issued by Afghan authorities for the raid to occur, the official said.
It remained unclear how or when the warrant would be issued.
One western official confirmed the committee mechanism but would not comment on any warrant procedure.
Afghan officials have insisted the raids be conducted in compliance with Afghan law, meaning any warrant or legal authority for a raid would have to occur before the operation.
Talks have been going on for weeks now on this key memorandum of understanding to address what is perhaps the most difficult issue in the partnership between Kabul and Washington.
The agreement would remove one of the obstacles in the way of a highly symbolic Strategic Partnership Document, outlining the basis for U.S.-Afghan cooperation for the years after NATO's 2014 drawdown.
Night raids also present a particular challenge to Afghan President Hamid Karzai. Their strong unpopularity has forced the president to demand they stop, or at least no longer involve foreign troops, despite their operational significance to NATO.
Allen told Congress last month how vital and frequent those raids are.
In 2011, 83% of the raids succeeded in detaining or striking either their primary target or an associated insurgent, he said.
"This last year, we had about 2,200 night operations," Allen told the Senate Armed Services Committee.
"Of those 2,200 or so night operations, on 90% of them we didn't fire a shot. On more than 50% of them we got the targeted individual, and (in) 30% more we got the next associate of that individual as well."
As for civilian casualties, in the 10% of the night raids where shots were fired, "less than 1.5 % civilian casualties" resulted, Allen said.
Pentagon spokesman George Little told reporters Wednesday that over 97% of the night raids are combined U.S.-Afghan operations, and almost 40% of the night raids are now Afghan-led.
Karzai says Afghanistan's homes and villages need to be safe and protected.
"What we are asking for, in very specific and clear terms, (is that) no foreign forces should enter Afghan homes," he said last year.