KABUL, Afghanistan - The Afghan government and the US signed a deal Sunday governing night raids by American troops, resolving an issue that had threatened to derail a larger pact governing a US presence in the country for decades to come. Night raids involve US and Afghan troops descending without warning on homes or residential compounds searching for insurgents. They are widely resented in this deeply conservative country. Afghan President Hamid Karzai had called repeatedly to stop the raids, saying that they make civilian casualties more likely and that international troops are disrespectful in the way they conduct the operations. The U.S. military has said such operations are essential for capturing Taliban and al-Qaida commanders. The resolution of this dispute is a key step toward finalizing a long-term "strategic partnership" to govern U.S. forces in Afghanistan after the majority of combat forces leave in 2014. The long-term pact is seen as important for assuring the Afghan people that they will not be abandoned by their international allies. The memorandum was signed in front of reporters by Kabul's Defense Minister Gen. Abdul Rahim Wardak and the commander of U.S. forces, Gen. John Allen. It appeared to give important benefits to both sides: the document gives the Afghans authority over the raids and gives the Americans an Afghan partner that will now be held equally to account if there are civilian casualties or allegations of mistreatment. It also was a sign that Karzai may be willing to compromise on some of his conditions for a long-term pact. Americans and even some of his own advisers feared that his unyielding bargaining style would endanger the entire agreement, and along with it Afghanistan's long-term security.