The new Afghan government has signed a security deal with American officials that will allow US troops to remain in the country beyond this year.
The agreement was signed by Afghanistan's newly appointed national security adviser, Hanif Atmar.
Previous President Hamid Karzai had refused to sign the Bilateral Security Agreement (BSA) with the US, straining ties and raising security fears.
Most Nato forces are to withdraw this year, leaving 9,800 US troops behind.
The total number of troops in a new Nato-led mission - including US soldiers - to train and assist Afghanistan's security forces will be about 12,000 next year.
There will also be a separate US-led force dealing with the remnants of al-Qaeda.
US ambassador to Kabul Jim Cunningham signed the long-delayed agreement on behalf of the government in Washington.