Media captionWatch President Trump address US troops: "The Taliban wants to make a deal"
by Melissa Gruz and Biodun Iginla, BBC News. Melissa Gruz is traveling with the President.
President Donald Trump has made an unannounced visit to American troops in Afghanistan and said the US and the Taliban have been engaged in talks.
"The Taliban wants to make a deal," Mr Trump told troops at Bagram airbase on his first trip to the country, where he also met Afghan President Ashraf Ghani.
The visit for Thanksgiving comes after a prisoner swap with the Taliban aimed at resuming peace negotiations.
Mr Trump also said the US was "substantially" reducing troop numbers.
Some 13,000 US troops remain in Afghanistan in what has become America's longest war, 18 years after the US intervention to oust the Taliban following the 11 September 2001 attacks.
Mr Trump's visit happened weeks after the Taliban freed two Western academics who had been held hostage since 2016 - American Kevin King and Australian Timothy Weeks - in exchange for three imprisoned senior militants.
"We're meeting with them [Taliban] and we say it has to be a ceasefire and they didn't want to do a ceasefire and now they want to do a ceasefire," Mr Trump said at the base near the capital, Kabul. "I believe it will probably work out that way."
It was not clear how long or substantive the talks have been.
Taliban leaders confirmed that meetings with senior US officials were being held in Doha since last weekend but that formal talks had not yet resumed, Reuters news agency reported.
Mr Trump also reaffirmed his plan to cut troop levels to about 8,600 but did not say how many personnel would leave or when. "We're going to stay until such time as we have a deal or we have total victory, and they want to make a deal very badly."

What else happened at the visit?

Mr Trump arrived at 20:30 local time (16:00 GMT) and left before midnight in a trip that was shrouded in secrecy for security reasons. The president served turkey to troops, sat down to eat Thanksgiving dinner with them before posing for photos.
He was greeted by US Joint Chiefs Chairman Gen Mark Milley who, on Wednesday, said the chances of a successful outcome from peace talks were higher than before and could happen in the "near term".
US President Donald Trump serves Thanksgiving dinner to US troops at Bagram Air FieldImage copyrightAFP
Image captionMr Trump served turkey to some troops during Thanksgiving celebrations
Meanwhile, President Ghani thanked the Americans who have made the "ultimate sacrifice" in Afghanistan in an address to the US troops, saying: "Afghan security forces are taking the lead now."
Reacting to the meeting on Twitter later, Mr Ghani did not mention Mr Trump's comments about talks with the Taliban and said: "Both sides underscored that if the Taliban are sincere in their commitment to reaching a peace deal, they must accept a ceasefire."

What happened to the peace talks?

Talks with the Taliban collapsed in September soon after President Trump invited senior Taliban leaders and President Ghani to meet at the US presidential retreat of Camp David, near Washington DC.
But a Taliban attack in the Afghan capital two days earlier, which killed a US soldier and 11 others, prompted Mr Trump to pull out, saying the group "probably don't have the power to negotiate" if they were unable to agree to a ceasefire during talks.
Mr Ghani said this month's prisoner exchange aimed to "facilitate direct peace negotiations." However, the Taliban have long refused to negotiate with Mr Ghani's administration, calling it a puppet of the US.

More on this story