The United States says it has agreed the text of a bilateral security agreement with Afghan officials that deal paves the way for some US troops to remain after 2014.
Late on Wednesday the Afghan foreign ministry published a draft deal that would give US troops remaining after 2014 immunity from Afghan courts.
The US had said all its troops would be withdrawn if no immunity was agreed.
The deal will be discussed by delegates at a meeting known as the Loya Jirga on Thursday.
US Secretary of State John Kerry said remaining US forces would have "a very limited role" to train, equip, and assist. "There is no combat role for the United States forces," he said.
Mr Kerry contradicted earlier reports that Afghanistan had asked for an apology from the US for mistakes made during the 12-year war.
"Let me be clear. President [Hamid] Karzai didn't ask for an apology. There was no discussion of an apology,'' he said.
Both sides had been refusing to budge on certain issues.
The Afghans have long opposed US raids on Afghan homes, particularly night raids because they are perceived to violate the sanctity of women in the home.
And the US had insisted that any troops remaining in Afghanistan after 2014 receive immunity from prosecution.