Ashraf Ghani speaks to the troops as US President Donald Trump listens during a surprise Thanksgiving day visit.

US President Donald Trump speaks to the troops during a surprise Thanksgiving day visit at Bagram Air Field.

US President Donald Trump speaks to the troops during a surprise Thanksgiving day visit at Bagram Air Field.

US President Donald Trump speaks to the troops during a surprise Thanksgiving day visit at Bagram Air Field.

US President Donald Trump serves Thanksgiving dinner to US troops at Bagram Air Field during a surprise visit.

US President Donald Trump serves Thanksgiving dinner to US troops at Bagram Air Field during a surprise visit.

President Donald Trump made a surprise, first visit to Afghanistan on Thanksgiving, serving dinner to US troops and announcing that he has re-opened peace talks with the Taliban.

“The Taliban wants to make a deal — we’ll see if they make a deal,” Trump said during a meeting with Afghan President Ashraf Ghani.

“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,” added Trump, who also reaffirmed his hope of reducing US troops in Afghanistan from nearly 14,000 down to 8,600.

“I’d like to thank you for your leadership, for your determination,” Ghani told Trump.

“Afghan security forces are taking the lead now,” he told the president.

“The Taliban wants to make a deal, and we’re meeting with them and we’re saying it has to be a ceasefire. And they don’t want to do a ceasefire, but now they do want to do a ceasefire, I believe.”

Trump made the surprise visit with a small group of aides — but not the first lady, who stayed behind at Mar-a-Lago — nearly two months after abruptly breaking off peace talks with the Taliban following a bombing in Kabul that left 12 people dead, including an American soldier.

The president was accompanied by senior aides, as well as Sen. John Barrasso (R-Wyo), and joined there by Mark Milley, chairman of the Joint Chiefs of Staff, who already had been traveling in the region.

The visit, which featured a warm welcome from cheering, applauding troops at Bagram Air Base, came after Trump managed to give the slip to reporters in Florida, taking off in secrecy from an undisclosed airfield there. The president arrived at Bagram just after 8:30 p.m. local time.

The trip — Trump’s second to a combat zone, following his post-Christmas visit to troops in Iraq last year — was concealed from his public schedule for security reasons.

He addressed some 1,500 troops in an aircraft hangar at the base, telling them to “get some well-deserved rest.”

He also told them Americans are thankful they’re fighting to protect their freedoms.

“We flew 8,331 miles to be here tonight for one simple reason: to tell you in person that this Thanksgiving is a special Thanksgiving,” he said.

“We are doing so well. Our country is the strongest economically it is ever been here. We thank God for your help and all the things that you’ve done,” he added.

“You are very special people, and you don’t even know how much the people of our country love and respect you. And they do. And that’s why I’m just bringing the message.”

Trump also said that while he wanted to win the war in Afghanistan — “We don’t play for ties,” he said — he hoped that “a political solution” would end the conflict, which is America’s longest war.

Many of the troops posed for pictures with the president, who smiled as he doled out trays of turkey and stuffing.

But when he finally sat down for his own Thanksgiving dinner, he was quickly pulled away for more photos.

“I never got the turkey,” he joked to the troops.

“A gorgeous piece of turkey.”

Tens of thousands of Afghan civilians and more than 2,400 American service members have been killed since the war began 18 years ago.

Just last week, Trump flew to Dover Air Force Base in Delaware to oversee the transfer of the remains of two Army officers killed when their helicopter crashed as they provided security for troops on the ground in Logar province in eastern Afghanistan.

The Taliban still controls or holds sway over about half of the country, staging near daily attacks targeting Afghan forces and government officials.

The US and Taliban had been close to an agreement in September that might have enabled a US troop withdrawal.

But then Trump abruptly broke off peace talks in September, canceling a secret meeting with Taliban and Afghan leaders at the Camp David presidential retreat after a particularly deadly spate of violence, capped by a bombing in Kabul that killed 12 people, including an American soldier.

That ended a nearly yearlong effort to reach a political settlement with the Taliban, the group that protected al Qaeda extremists in Afghanistan, prompting US military action after the Sept. 11, 2001, terrorist attacks.

US and international forces have been on the ground ever since.

It was not immediately clear how long or substantive the US reengagement with the Taliban has been.

With Post wires