KABUL - Officials from Afghanistan and the United States on Tuesday signed a long-delayed security agreement to allow American troops to stay in the country after the end of the year, filling a campaign promise by new President Ashraf Ghani.National security adviser Hanif Atmar and US Ambassador James Cunningham signed the bilateral security agreement in a televised ceremony at the presidential palace, one day after Ghani was inaugurated."As an independent country ... we signed this agreement for stability, goodwill, and prosperity of the our people, stability of the region and the world," Ghani said in a speech after the signing.Ghani's predecessor, Hamid Karzai, had long refused to agree to the deal, souring his ties with the United States. Karzai cited his anger over civilian deaths and his belief that the war was not fought in the interests of his country.Cunningham said the pact showed the United States remained committed to Afghanistan, where foreign forces have helped provide security since the 2001 toppling of the radical Islamist Taliban government over its sheltering of planners of the Sept. 11 attacks."It is a choice by the United States to continue cooperating with our Afghan partners on two important security missions: training and equipping Afghan forces and supporting cooperation against terrorism," Cunningham said.