Trump has long wanted to draw down forces in Afghanistan and his visit here comes as the Afghan government, together with a foreign force of around 15,000 USA and North Atlantic Treaty Organisation troops, is locked in an extended stalemate with the Taliban.
Trump also announced peace talks with that Taliban have been restarted after the president broke off talks following a bombing in September that killed an American soldier and 11 other people.
"The Taliban wants to make a deal and we're meeting with them", he said.
Trump, who was accompanied by USA national-security adviser Robert O'Brien, met with Ghani.
Trump has repeatedly questioned why the United States has kept troops in Afghanistan after almost two decades of fighting, billions of dollars in aid, and more than 2,000 US military lives have failed to transform the country.
Trump ran his 2016 campaign promising to end the nation's "endless wars" and has been pushing to withdraw troops from Afghanistan and in the Middle East, despite protests from top US officials, Trump's Republican allies in Washington and many USA allies overseas.
"Afghan security forces are taking the lead now", Ghani said.
In a visit due to last about two-and-half hours, Trump served turkey to troops in a cafeteria, posed for photographs, and delivered remarks in a hangar, as well as meeting Afghan president Ashraf Ghani.
President Trump was scheduled to spend Thanksgiving at his Mar-a-Lago club in Palm Beach, Flordia. According to the White House pool, Air Force One "took off and landed in the dark with interior lights off and shades drawn". This evening, as millions of families sit down at their dinner tables back home, they'll say a prayer for the men and women serving in our nation in Afghanistan and deployed all around the globe. John Barrasso (R-WY), and White House press secretary Stephanie Grisham.
"It's a unsafe area and he wants to support the troops", Grisham told reporters before Trump landed.
"There's nowhere I'd rather celebrate this Thanksgiving than right here with the toughest, strongest, best and bravest warriors on the face of the earth - you are indeed that", the president told the troops.
He also served turkey to some USA troops and sat down to eat Thanksgiving dinner with them.