Democratic presidential candidates gather on stage for a debate in Houston, Texas on Sept. 12, 2019 . (Callaghan O'Hare/Bloomberg)

Thursday’s democratic debate in Houston took place less than a week after President Trump unexpectedly called off peace talks with the Taliban, following landmark meetings between American and Taliban representatives in Qatar that had raised hopes for an end to nearly 18 years of war in Afghanistan.

As details of a draft deal emerged early this month, the Afghan government, which was excluded from the talks, publicly expressed concerns the agreement would not do enough to guarantee the safety of Afghan civilians and service members following a U.S. troop withdrawal.

And as criticism of the deal mounted, Trump announced on Twitter that he had invited Taliban and Afghan leaders for a secret summit at Camp David but called it off when the Taliban claimed responsibility for a Sept. 5 car bomb in Kabul that killed two NATO troops, including an American.

His announcement threw the peace process into limbo, with Taliban spokesman Suhail Shaheen tweeting that Trump’s announcement was “disappointing,” “unbelievable” and “certainly damaged his credibility.”

On Thursday, debate moderator David Muir kicked off a discussion on the war in Afghanistan by challenging Massachusetts Sen. Elizabeth Warren to defend her position on immediate U.S. troop withdrawal.

“We all know the presidency is much different from the campaign trail,” he said. “President Obama wanted to bring the troops home. President Trump promised to bring the troops home.”

Two-and-a-half years into Trump’s presidency, there are around 14,000 U.S. troops on the ground in Afghanistan — more than when he took office in 2017.

The draft peace deal initially negotiated with the Taliban outlined a plan to close five U.S. military bases and bring home around 5,400 troops within five months of a deal being signed.

Still, on Thursday, Warren said she would stick to her plan to bring U.S. troops home.

“What we’re doing right now in Afghanistan is not helping the safety and security of the United States,” she said. “It is not helping the safety and security of the world. It is not helping the safety and security of Afghanistan.”

“We’re not going to bomb our way to a solution in Afghanistan,” she said, urging American investment instead in economic and development programs that could help root out terrorism there and elsewhere.

Many Afghan women had expressed concerns that a deal with the Taliban could lead to the militant group’s return to power. When the Taliban ruled over Afghanistan from 1996 to 2001, women essentially disappeared from public life. They were not allowed to attend school or show their faces in public. To walk outside, they needed to be accompanied by a male family member, even if he was a child.

The United States invaded Afghanistan in Oct. 2001, and soon toppled the Taliban government, which had provided safe haven to al-Qaeda, the group behind the 9/11 attacks.

After being excluded from the talks, the current Afghan government, which is trying to organize elections for Sept. 28, saw this month’s canceled deal as somewhat of a win and has pledged to launch an Afghan-led process immediately after the controversial September vote.

Muir pressed Warren on her plan to withdraw, saying even U.S. military leaders have made clear they believe troop withdrawal can’t happen without a deal with the Taliban — a view many Afghans also hold.

“Would you listen to their advice?” he asked. Warren replied that military officials struggle to describe what winning in Afghanistan looks like “because the problems in Afghanistan are not problems that can be solved by a military.”

Muir then kicked the question to Pete Buttigieg, mayor of South Bend, Indiana and the only veteran onstage last night. He deployed to Afghanistan for seven months in 2014.

Muir asked him if he would table earlier plans to bring U.S. troops home within a year of taking office after General Joseph F. Dunford Jr., chairman of the Joint Chiefs of Staff, recently warned that U.S. withdrawal couldn’t be considered while Afghans still need significant support to deal with increased levels of violence.

Buttigieg said that to avoid getting caught up in any “endless wars” he would implement a “three-year sunset” for authorization of military force.

“Congress will be required to vote and a president will be required to go to Congress to seek an authorization,” he said. “Because if our troops can summon the courage to go overseas, the least our members of Congress should be able to do is summon the courage to take a vote on whether they ought to be there.”

Muir then turned a variation of the question to former vice president Joe Biden, pointing to concerns a security vacuum could emerge in Afghanistan if U.S. troops withdraw. He asked if Biden regretted quickly pulling troops out of Iraq during the Obama administration and if he believed that withdrawal helped pave the way for the Islamic State to take over much of Iraq’s territory.

Biden said it “wasn’t wrong to pull out” of Iraq, then turned to Afghanistan, offering a meandering response but ultimately stating: “We don’t need those troops there. I would bring them home.”

Muir then asked Vermont Sen. Bernie Sanders what he made of concerns that a rapid withdrawal from Afghanistan could turn the country back into a militant safe haven. Sanders cited his own record voting against the war in Iraq and against Trump’s military budgets.

“I don’t think we have to spend $750 billion a year on the military when we don’t even know who our enemy is,” he said.

Correction: A previous version of this story incorrectly attributed a question to moderator George Stephanopoulos. It was moderator David Muir who asked the question. The article has been updated.

Read more:

Theirs was the ‘purest love.’ Then a suicide bombing changed everything.

The Taliban tried to wipe out Afghanistan’s film industry. This is what survived.

For Afghan women, competing in the Olympics is only part of the struggle