Speaking to a joint session of Congress in the House of Representatives, Trump noted that the U.S. military is making progress in Afghanistan, and peace talks with the Taliban militant group are underway.
"We are working to finally end America's longest war and bring our troops back home," Trump said.
"It is also not our function to serve other nations as a law enforcement agency," he added.
Peace talks between the United States and the Taliban began last year but have been interrupted at least twice after Taliban attacks on U.S. military personnel in September and December.
Trump has long grumbled about the U.S. military presence in Afghanistan that started in 2001, calling it "ridiculous."
The United States maintains roughly 13,000 troops in Afghanistan, which mostly provide training missions to local Afghan forces while also conducting counterterrorism operations.
The war in Afghanistan is the longest one in U.S. history. The death toll of U.S. service members has surpassed 2,400 since the country invaded Afghanistan in 2001.