The American presence in Afghanistan was "never meant to be a multi-generational undertaking", US President Joe Biden has told Congress in his maiden address.
He also reassured Americans that his administration would maintain capabilities to suppress future threats.
"We have the greatest fighting force in the history of the world," the US President said.
"And I'm the first president in 40 years who knows what it means to have a son serving in a war zone.
"Today we have service members serving in the same war zone as their parents once did.
"We have service members in Afghanistan who were not yet born on 9/11.
"The war in Afghanistan was never meant to be a multi-generational undertaking of nation-building.
"We went to Afghanistan to get the terrorists who attacked us on 9/11."
He went on: "We delivered justice to [Osama] Bin Laden and we degraded the terrorist threat of al Qaeda in Afghanistan.
"After 20 years of valour and sacrifice, it's time to bring our troops home.
"Even as we do, we will maintain an over-the-horizon capability to suppress future threats to the homeland.
"But make no mistake, the terrorist threat has evolved beyond Afghanistan since 2001 and we will remain vigilant against threats to the United States, wherever they come from.
"Al Qaeda and ISIS are in Yemen, Syria, Somalia, and other places in Africa and the Middle East and beyond.
"And, we won't ignore what our own intelligence agencies have determined, the most lethal terrorist threat to the homeland today is from white supremacist terrorism," he added.
There were 2,500 to 3,000 US troops in Afghanistan when President Biden took office in January.
Earlier this month, Mr Biden announced that he was withdrawing all US troops from Afghanistan over the coming months by 11 September.
NATO followed suit, announcing it would begin removing military personnel from the country on 1 May, with the UK confirming it would be part of the "drawdown".
In the last 20 years, 150,610 UK personnel have served in Afghanistan.
General Sir Nick Carter, head of Britain's Armed Forces expressed disappointment at the decision to withdraw, stating it was "not a decision we hoped for", although he added that the UK respected the view taken by the new US administration.