President Barack Obama has confirmed plans to extend the US military presence in Afghanistan beyond 2016, in a shift in policy.
Speaking at the White House, he said the US would keep 5,500 troops in the country when he leaves office in 2017.
Originally all but a small embassy-based force were due to leave by the end of next year.
But the US military says more troops will be needed to help Afghan forces counter a growing Taliban threat.
There are currently 9,800 US troops stationed in Afghanistan.
The US forces will be stationed in four locations – Kabul, Bagram, Jalalabad and Kandahar.
‘The right thing’
Announcing the plan on Thursday, President Obama said the troop extension could “make a real difference” for Afghanistan and Afghan security forces, which he acknowledged were “not as strong” as they needed to be.
He said the ending of Nato combat operations in December last year had come at a price, with many Afghan troops and civilians killed since the Taliban stepped up its insurgency.
“It’s the right thing to do,” the president said about the policy change. “As commander in chief I will not allow Afghanistan to be used as safe haven for terrorists to attack our nation again.”
For the Taliban, he continued, it should be clear that the only way to achieve a full pullout of US troops is through a lasting settlement with the Afghan government.
He described the mission in Afghanistan as “vital to US national security interests”.
Afghan President Ashraf Ghani is expected to welcome the move, as he had been pushing for a slower withdrawal of US troops to allow Afghan forces to be better trained and equipped.
The top US military commander in Afghanistan, Gen John Campbell, expressed concern last week over the “tenuous security situation” and said an enhanced military presence would be necessary if the Taliban were to be repelled.
He was speaking days after the Taliban briefly seized the northern city of Kunduz – their most spectacular military gain since being ousted from power in 2001.
After the Taliban’s surprise attack on Kunduz, Afghan government forces managed to retake control of key areas of the city with the aid of Nato special forces and US air strikes.
But the city’s brief capture was seen as a setback for the Afghan authorities under pressure to show they can keep the country secure without the backing of international forces.
The south-eastern city of Ghazni has also seen fierce clashes between Taliban insurgents and US-trained Afghan troops in recent days.
Militant violence has increased across Afghanistan since Nato ended its combat mission there in December 2014, leaving a residual force – mainly US troops – used for training and counter-terrorism operations.
The shift in policy comes at the same time as three separate investigations – by the US, Nato and Afghan authorities – into a US air attack on an MSF-run hospital in Kunduz that killed 22 people.
The US said the bombing was a mistake, and President Obama later apologised.