In a speech to troops in southern Kandahar, birthplace of the Taliban, President Ashraf Ghani said Trump's first formal address as commander-in-chief today showed that America was "with us, without any time limit".
"You cannot win this war," Ghani told the Taliban, calling on them to join talks and saying that Afghanistan wants peace with neighbouring Pakistan, long accused of fuelling the insurgency.
Trump pilloried US ally Pakistan for offering safe haven to "agents of chaos". He discarded his previous criticism of the 16-year-old war as a waste of time and money, admitting things looked different from "behind the desk in the Oval Office".
But following months of deliberation, Trump said he had concluded "the consequences of a rapid exit are both predictable and unacceptable" -- a vacuum which terrorists "would instantly fill".
More From This Section
While Trump refused to offer detailed troop numbers, senior White House officials said he had already authorised his defence secretary to deploy up to 3,900 more troops to Afghanistan.
Trump warned that the approach would now be more pragmatic than idealistic. Security assistance to Afghanistan was "not a blank check" he said, adding: "We are not nation- building again. We are killing terrorists."
In response to Trump, the Islamist group vowed to make the country "a graveyard" for the US and said it would continue its "jihad" as long as American troops remained in the country.
"If America doesn't withdraw its troops from Afghanistan, soon Afghanistan will become another graveyard for this superpower in the 21st century," spokesman Zabiullah Mujahid said in a statement.
But ahead of the speech Pakistan's military insisted the country has done all it can to tackle militancy.
Trump for the first time also left the door open to an eventual political deal with the Taliban.
"Someday, after an effective military effort, perhaps it will be possible to have a political settlement that includes elements of the Taliban in Afghanistan," he said.
"But nobody knows if or when that will ever happen," he added, before vowing that "America will continue its support for the Afghan government and military as they confront the Taliban in the field".
In 2010 the US had upwards of 100,000 US military personnel deployed to Afghanistan. Today that figure is around 8,400 US troops and the situation is as deadly as ever.
More than 2,500 Afghan police and troops have been killed already this year.