Three months after dramatically calling off peace negotiations with the Taliban, Donald Trump announced he would restart the talks, during a surprise trip to visit U.S. troops in Afghanistan on Thursday.

In a stop at Bagram Air Field with Afghan President Ashraf Ghani, Trump said leaders of the Taliban “want to make a deal very badly,” and suggested they may be open to a ceasefire. He also reiterated his desire to reduce the number of troops in the country, but said American forces would remain there “until such time as we have a deal or we have total victory.”

"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,” he told reporters. “That's fine."

Trump called off a secret meeting with the Taliban at Camp David in September, after an attack in Kabul that killed a U.S. soldier. Many U.S. diplomats and politicians were shocked by the president’s decision to invite the Taliban to the U.S. so close to the anniversary of 9/11, and praised his decision to cancel the meeting.

But Trump has continued to discuss reducing the number of troops in Afghanistan to 8,600, from the current levels of less than 14,000. On Thursday, in this first visit to Afghanistan, he said the U.S. military had continued to make “tremendous progress” in the region while paring down the number of troops stationed there. Ghani thanked Trump for his “leadership” and “determination” and said Afghan security forces had begun taking the lead.

The trip came shortly after the Washington Post reported that a former conservative radio host who previously suggested dropping nuclear bombs on Afghanistan had been hired as a senior adviser for arms control at the State Department.

Trump also met with U.S. service members on his visit, which coincided with the Thanksgiving holiday. He served turkey and posed for pictures with the approximately 500 military personnel gathered at the base, according to pool reports. A White House spokesperson said the trip had been in the works for weeks but was kept secret for security reasons.

The war in Afghanistan is the longest in U.S. history, and more than 2,400 Americans have died since it began. Nineteen Americans have died in the conflict this year, making it the deadliest on record for American forces since 2014.