BAGRAM AIR FIELD, Afghanistan — President Trump paid an unannounced Thanksgiving visit to American troops here on Thursday, and said that he has restarted peace negotiations with the Taliban less than three months after he scuttled talks with the group.
“The Taliban wants to make a deal, and we’re meeting with them,” Mr. Trump said here during a meeting with Afghanistan’s 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 to make a deal very badly,” said Mr. Trump, who reaffirmed his desire to reduce America’s troop presence here from 12,000 to 13,000 to 8,600.
Mr. Trump made his first visit to Afghanistan under a shroud of secrecy, arriving in a darkened airplane just after 8:30 p.m. local time on a trip that the White House had concealed from his public schedule for security reasons.
Mr. Trump carried out the traditional role of feeding turkey and mashed potatoes to American troops in fatigues, before dining, mingling and posing for photographs before he delivered remarks celebrating America’s military in an aircraft hangar.
But his visit also had an important political dimension, and comes at a crossroads for Afghanistan and the United States military presence here months after Mr. Trump angrily called off his talks with the Taliban, which had produced a draft agreement that would begin the phased withdrawal of American forces from the country.
Mr. Trump, who boasted of American military successes against Al Qaeda and the Islamic State, suggested that the Taliban is eager to make a peace deal, but that he himself is indifferent to that outcome.
“The Taliban wants to make a deal — we’ll see if they make a deal. If they do, they do, and if they don’t they don’t. That’s fine,” Mr. Trump said.
He also said that the Taliban is now willing to agree to a cease-fire, a matter of contention in the earlier talks and something that Mr. Ghani’s government has been insistent upon.
“We’re saying it has to be a cease-fire, and they didn’t want to do a cease-fire,” Mr. Trump said of the Afghan insurgents. “Now they do want to do a cease-fire. I believe it’ll probably work out that way.”
Mr. Ghani later joined Mr. Trump onstage for remarks to several hundred American soldiers gathered in an aircraft hanger. The appearance of a foreign leader before American troops was unusual. Mr. Ghani, giving an energetic, almost campaign-style speech, praised Mr. Trump as “the architect” of a strategy for “wiping out Al Qaeda” in Afghanistan, and hailed him for the killing is ISIS leader Abu Bakr al-Baghdadi.
He arrived in Afghanistan one day after at least 13 people were killed when their car struck a roadside bomb on the way to a wedding party in Taliban-controlled territory northern Afghanistan, officials said. Most of the victims were related to each other.
Peace negotiations with the Taliban have stalled after gaining traction earlier this year and seemed close to an agreement in late summer expected to reduce the American military presence, which numbers from 12,000 to 13,000 troops, by several thousand.
The talks collapsed in stunning fashion on Sept. 7, after Mr. Trump disclosed via Twitter that he was quashing plans for a dramatic meeting at his Camp David presidential retreat with Taliban leaders and Afghan government officials. Angrily citing a Taliban attack in Kabul which killed an American soldier as the plans were coming together, Mr. Trump called off the discussions entirely.
But administration officials say Mr. Trump remains eager to bring an end to the American role in Afghanistan, which costs billions of dollars each year and continues to claim American lives. Earlier this month, Mr. Trump visited Dover Air Force Base in Maryland to pay his respects during the return of two Americans killed in a Nov. 20 helicopter crash in Afghanistan.
Mr. Trump is also searching for foreign policy achievements he can celebrate on the campaign trail over the next year. Several of his other marquee initiatives, including nuclear talks with North Korea and an effort to squeeze concessions out of Iran with economic pressure, have yielded few results.
It was never clear how imminent a peace agreement truly was in September. Taliban leaders said they had not committed to a Camp David visit, and Afghanistan’s president, Ashraf Ghani, was deeply skeptical of a United States agreement with the Taliban.
A prisoner exchange between the Afghan government and the Taliban this month, brokered in part by Mr. Trump’s Afghanistan envoy, Zalmay Khalilzad, has raised new hopes that talks could begin anew. Mr. Ghani said in a televised address that the swap was meant to “facilitate direct peace negotiations.”
But uncertainty about the country’s future in the wake of its disputed election results could make brokering a meaningful peace difficult.
And Mr. Trump may be proceeding on his own. The goal of his past talks with the Taliban was to trade an American pledge to withdrawal for a Taliban renunciation of its terrorist allies like Al Qaeda and the start of Taliban negotiations with Afghanistan’s government.
But American troops are already exiting the country. A month ago, the top American commander in Afghanistan, Gen. Austin Miller, said that United States forces in the country had dropped by 2,000 over the last year.
Some current and former military officials are worried that Mr. Trump’s appetite for a troop reduction he can boast about on the campaign trail as a fulfillment of his promise to scale back American foreign interventions could lead to serious national security risks.
Writing in the Washington Post this month, retired Gen. David Petraeus, a former commander of American forces in Afghanistan, warned that the Trump administration should only strike a deal with the Taliban on more demanding terms that those being considered before talks fell apart.
Mr. Petraeus, writing with Vance Serchuck, an adjunct fellow at the Center for a New American Security, also warned that the United States must be prepared to conduct ongoing counterterrorism missions in the country.