"I could win that war in a week. Afghanistan would be wiped off the face of the earth... literally in 10 days," Trump said on Monday, as he met with Pakistani Prime Minister Imran Khan at the White House.
"I don’t want to go that route,” the president added. "I don’t want to kill 10 million people."
Mr Trump added that he expects Pakistan to help the US withdraw its troops from Afghanistan.
"We’ve been there for 19 years, and we’ve acted as policemen, not soldiers," he said.
Mr Khan expressed hope that within weeks the Afghan government would agree to sit down for direct talks with the Taliban.
In January, US peace envoy Zalmay Khalilzad said that an agreement with the Taliban on the withdrawal of US troops had been reached "in principle." But some outstanding issues remain to be resolved.
Trump's meeting with Mr Khan was intended to improve relations between the two countries which have been negatively impacted by the conflict in Afghanistan. Last week, the Trump administration and Congress repeatedly stressed that aid to Pakistan would be suspended unless the country showed concrete results in the fight against those terrorists who have strongholds on its soil.
During the meeting at the White House, Mr Trump said that his country could restore aid to Pakistan, depending on the results the country achieves in its war on terror, and also offered assistance to Islamabad in its attempts to mend ties with India, Reuters says.