President Trump says it is "time to bring our people back home" after the US signed a deal with the Taliban aimed at bringing peace to Afghanistan.
Mr Trump said 5,000 US troops would leave Afghanistan by May and he would meet Taliban leaders in the near future, without specifying where.
The US and Nato allies have agreed to withdraw all troops within 14 months if the militants uphold the historic deal.
Talks between the Afghan government and the Taliban are due to follow.
Under the agreement, the militants also agreed not to allow al-Qaeda or any other extremist group to operate in the areas they control.
The US invaded Afghanistan weeks after the September 2001 attacks in New York by al-Qaeda, then based in Afghanistan. The Taliban were ousted from power but became an insurgent force that by 2018 was active in more than two-thirds of the country.
More than 2,400 US troops have been killed during the conflict. About 12,000 are still stationed in the country.
What else did Trump say about the deal?
Speaking at the White House, Mr Trump congratulated Secretary of State Mike Pompeo, Defense Secretary Mark Esper and "the people of the United States for having spent so much in terms of blood, in terms of treasure, and treasury."
He said the Taliban had been trying to reach an agreement with the US for a long time, and that he had faith in the deal because "everyone is tired of war."
The president added that US troops had been killing terrorists in Afghanistan "by the thousands" and now it was "time for someone else to do that work and it will be the Taliban and it could be surrounding countries".
"I really believe the Taliban wants to do something to show we're not all wasting time," he added. "If bad things happen, we'll go back with a force like no-one's ever seen."
What happened in Doha?
The deal was signed by US special envoy Zalmay Khalilzad and Taliban political chief Mullah Abdul Ghani Baradar with Mr Pompeo as a witness.
In a speech, Mr Pompeo urged the militant group to "keep your promises to cut ties with al-Qaeda".
Mr Baradar said he hoped Afghanistan could now emerge from four decades of conflict.
"I hope that with the withdrawal of all foreign forces from Afghanistan the Afghan nation under an Islamic regime will take its relief and embark on a new prosperous life," he said.
Afghanistan's government did not take part in the US-Taliban talks, but said it was ready to negotiate with the Taliban.
What's in the agreement?
In addition to withdrawing US and allied troops, the deal also provides for a prisoner swap.
Some 5,000 Taliban prisoners and 1,000 Afghan security force prisoners would be exchanged by 10 March, when talks between the Taliban and the Afghan government are due to start.
The US will also lift sanctions against the Taliban and work with the UN to lift its separate sanctions against the group.
In Kabul, activist Zahra Husseini said she feared the deal could worsen the situation for women in Afghanistan.
"I don't trust the Taliban, and remember how they suppressed women when they were ruling," the 28-year-old told AFP.
"Today is a dark day, and as I was watching the deal being signed, I had this bad feeling that it would result in their return to power rather than in peace."
A cautious peace for Afghanistan
By Secunder Kermani, BBC News, Kabul
US, Afghan and Taliban officials have all been careful to avoid calling today's agreement in Doha "a peace deal." But in Afghanistan, a sense of cautious optimism has been rising.
The Afghan war has been a bloody stalemate for years now, with the Taliban increasingly controlling or contesting more territory, yet unable to capture and hold major urban centres.
With this has come a growing realisation – by both the Taliban and the US – that neither side is capable of an outright military victory.
This deal now opens the door to wide-ranging talks between the militants and Afghan political leaders.
But these discussions will be much more challenging – somehow there will have to be a reconciliation between the Taliban's vision of an "Islamic Emirate" and the democratic modern Afghanistan that has been created since 2001.
The priority for many ordinary Afghans, at least in the short term, is a substantive reduction in violence. We'll find out in the coming weeks, when the warmer spring weather generally heralds the start of "fighting season", if that will happen.
What reaction has there been?
- UN Secretary-General Antonio Guterres stressed "the importance of sustaining the nationwide reduction in violence, for the benefit of all Afghans"
- Nato Secretary-General Jens Stoltenberg: "We went in together in 2001, we are going to adjust [troop levels] together and when the time is right, we are going to leave together, but we are only going to leave when conditions are right"
- UK Defence Secretary Ben Wallace: "I welcome this small but important step towards the chance for Afghans to live in peace, free from terrorism… We remain absolutely committed to building an Afghanistan that Read More – Source