Two Western hostages were released after three Taliban prisoners landed in Qatar as part of a prisoner swap deal.
Trump’s visit on Thursday was his first to the South Asian country since becoming president. It came a week after a prisoner swap, partially brokered by the US, in which two Western hostages were traded for three Taliban commanders, that had raised hopes for the revival of peace talks.
“The Taliban wants to make a deal and we are meeting with them and we are saying it has to be a ceasefire and they didn’t want to do a ceasefire and now they do want to do a ceasefire, I believe. It will probably work out that way,” he told reporters.
Earlier this year, the US reached a deal in principle with the Taliban group to pull out troops from the country and wind down the 18-year war in return for security guarantees.
But Trump made a shock move in September, describing the year-long talks as “dead”, and withdrawing an invitation to the group to meet near Washington due to the killing of a US soldier.
The US president had more recently suggested that the negotiations could get under way again.
The Taliban have refused to negotiate formally with the Afghan government, but diplomatic efforts continue to foster dialogue.
Trump’s Air Force One presidential plane touched down at Bagram airfield after an overnight flight from Washington with White House National Security Adviser Robert O’Brien, a small group of aides and secret service agents, and a pool of reporters.
In a visit due to last about two-and-half hours, he served turkey to troops in a cafeteria, posed for photographs and delivered his remarks in a hangar.
He also met Afghan President Ashraf Ghani, though the details of what transpired in their meeting has not been made public yet.
About 13,000 US troops remain in Afghanistan, 18 years after the US invaded the country in the wake of the September 11, 2001 attacks.
Al Jazeera’s Rosiland Jordan, reporting from Washington DC, said the visit was “significant”, although she added that it was not clear if he has secured significant concessions from the Taliban, including the laying down of arms.
She also said that by visiting Afghanistan, Trump could also be trying to deflect political problems at home as he faces possible impeachment.
Rina Shah, a Republican political strategist, said that Trump wants to boost his approval rating by showing that he embraces that military.
“He wants to make sure that as he goes into the new year, which is very much around the corner, that he is secured, that he is going to look good in the face of the American public,” she said.