Key Issue Said to Be Resolved in U.S.-Afghan Security Talks KABUL, Afghanistan - Afghan officials said Tuesday that President Hamid Karzai would clear the way for a long-term security pact with the United States after receiving assurances that President Obama would issue a contrite letter acknowledging American military mistakes in Afghanistan and vowing not to repeat them. Mr. Karzai's spokesman, Aimal Faizi, said that in return for the letter, the Afghan leader would change course and accept wording allowing American-led raids on Afghan homes under "extraordinary circumstances" to save the lives of American soldiers. Just two days earlier, Afghan officials said that the issue had effectively stalemated talks over a broader bilateral security agreement, which would establish a framework for the continued presence of American troops in Afghanistan after the current 2014 deadline for Western troop withdrawal. The Afghans said that the breakthrough came about during a phone call by Secretary of State John Kerry to President Karzai on Tuesday. Mr. Kerry initially offered to write the letter, and Mr. Karzai said he would compromise if President Obama sent it instead - a stipulation that Mr. Kerry agreed to, according to Mr. Faizi. A spokesman for the American Embassy, Robert Hilton, would not comment on details of the negotiations. And the White House spokesman, Jay Carney, would not comment on whether President Obama had agreed to such terms. But even if both sides agree on a final wording for the security deal, the Afghans have made their final approval contingent on a vote this week by a loya jirga - a grand council of Afghan elders. Any wording allowing raids on Afghan homes is likely to be met negatively at the meeting, given the deep outrage such missions have caused for years. But Mr. Faizi said that such a letter from Mr. Obama would help win critics over. Mr. Carney nodded to the council's potential deal-breaker role in his comments on Tuesday. "There are ongoing negotiations," he said. I would simply say this agreement is not reached until it goes through the loya jirga. American commanders have insisted that home raids are critical to the fight against Al Qaeda and similar extremists hiding in Afghanistan. But such raids are deeply offensive to the Afghan public, and President Karzai has long insisted that only Afghan forces be allowed to conduct them. Mr. Faizi made it clear that the Afghans had a very detailed understanding of what they expected a letter from Mr. Obama to say, and without that there would be no deal. The letter would clarify exactly what was meant by "extraordinary circumstances" justifying home raids, and go beyond that as well. "The idea was to indeed mention that there were mistakes made in the conduct of military operations in the past, in the conduct of military operations by United States forces in the last decade, and that Afghans have suffered, and that we understand the pain and therefore we give assurances and make sure those mistakes are not repeated," Mr. Faizi said, summarizing what Mr. Karzai expected Mr. Obama to say in the letter. While Mr. Faizi declined to characterize that as a letter of apology, many would likely view it that way, and it was unclear how far Mr. Obama would be willing to go in providing a letter that satisfied Mr. Karzai's demands. Afghan officials said they expected to see the text of the letter by Wednesday before Mr. Karzai signs off on the security agreement. With one day remaining to finalize the wording of the security agreement before the loya jirga meets, Mr. Faizi said that was the last remaining issue in talks, carried out in their last phase by President Karzai with the American ambassador, James B. Cunningham, and the American military commander, Gen. Joseph F. Dunford Jr. "The rest, everything is solved," Mr. Faizi said. He also said that the Afghan side had agreed to acquiesce on another enduring sticking point: the American requirement that the United States retain legal jurisdiction over its soldiers in Afghanistan. In essence, that would make American military personnel immune to Afghan prosecution for their actions in the country, though they would remain subject to American prosecution. A similar requirement led to the collapse of talks with Iraq to establish a long-term security deal, and an immediate final withdrawal of American troops from that country in 2011. Mark Landler contributed reporting from Washington.