Afghan president swearing-in and Ashraf Ghani's invitation to Taliban for talks
Afghanistan's new President Ashraf Ghani Ahmadzai (C) arrives for his inauguration as president in Kabul Omar Sobhani/Reuters

Afghan and American officials have agreed to the signing of a security agreement which will see American troops remain in the country after the end of the year, after a shift in policy under the newly-elected President Ashraf Ghani.

National Security Adviser Hanif Atmar and US Ambassador James Cunningham signed the security pact in a televised ceremony at the presidential palace just a day after Ghani was inaugurated.

His predecessor, Hamid Karzai, continuously refused to agree to the security arrangement, damaging relations with Washington.

The agreement will see approximately 12,000 foreign troops stay and train Afghan security forces after the conclusion of the US-led coalition's combat operation at the end of 2014.

"The signing sends the message that President Ghani fulfils his commitments. He promised it would be signed the day after inauguration," said Daoud Sultanzoy, one of Ghani's senior aides.

"It shows the president's commitment to the Afghan security forces and confidence in our future relationship with the US. We are replacing uncertainty with certainty."

US State Department spokeswoman Jen Psaki said that the agreement would "enable Afghanistan, the United States and the international community to maintain the partnership we've established to ensure Afghanistan maintains and extends the gains of the past decade."

The 12,000 foreign soliders will consist of 9,800 American troops, with the remaining soldiers made up of military personnel from Germany, Italy and other Nato members.