President Obama was speaking at the White House on Tuesday, days after he paid a surprise visit to the Bagram air base in Afghanistan on the weekend, to thank US troops as they prepare to leave the country.
His plan to put an end to America's longest war comes 15 years after the September 11 attacks in New York. US forces were sent within a month of the attacks.
Obama said that forces had struck significant blows against al Qaeda and removed Osama bin Laden, as well as the possibility of Afghanistan being used as a base against the US.
Currently 32,000 US troops are in Afghanistan. Obama announced on Tuesday that 9800 would remain after the end of this year. These soldiers would not be engaged in combat missions, and will instead work in counterterrorism and training local security forces.
The number of troops will drop to 5000 at the end of 2015, with fewer than 1000 remaining a year after that. Obama's plan is for there to be a normal US embassy presence and a security assistance component by the end of 2016.
"We have been in Afghanistan longer than many Americans expected," he told reporters at the White House Rose Garden.
"Now we're finishing the job we started."
But the plan to keep US troops there depends on an as-yet unsigned bilateral agreement. Afghanistan's outgoing president, Hamid Karzai, has refused to sign it, but the two candidates hoping to be his successor after next month's run-off vote - Ashraf Ghani and Abdullah Abdullah - have said they will cooperate.
Obama said the withdrawal of US troops would allow the money saved to be redirected elsewhere "to the changing threat of terrorism."
"I think Americans have learned that it's harder to end wars than it is to begin them."
The 9800 US forces remaining next year will likely be supported by NATO troops. The total NATO presence, including US troops, is expected to be 12,000 at the start of next year.
A NATO spokeswoman said Obama's statement was consistent with plans the alliance was drawing up for its own training and support mission in Afghanistan.
"I expect NATO defense ministers will discuss the completion of our ISAF (International Security Assistance Force) combat mission and preparations for the new mission when they meet in Brussels next week," said Oana Lungescu.
jr/av (AFP, AP)