“So, look, I think we ought to get out of the Middle East,” Ms. Warren said. “I don’t think we should have troops in the Middle East, but we have to do it the right way, the smart way.”

Sign up for On Politics to get the latest election and politics news and insights. Sign up for our politics newsletter

Mr. Sanders said Mr. Trump’s credibility was completely undermined.

“Now you tell me what country in the world will trust the word of the president of the United States?” Mr. Sanders said. “In other words, what he has done is wreck our ability to do foreign policy, to do military policy, because nobody in the world will believe this pathological liar.”

And then there was Representative Tulsi Gabbard, whom Senator Kamala Harris had called an apologist for Syria’s president, Bashar al-Assad. In 2017, Ms. Gabbard visited Mr. Assad, whose government used chemical weapons against rebels during a May 2018 attack in Syria’s civil war, the United States concluded.

Ms. Gabbard, who was deployed to Iraq, criticized the presence of American troops in Syria and the Trump administration’s handling of their withdrawal, both of which she said contributed to the killing of Kurds by Turkish-backed forces.

“First of all, we’ve got to understand the reality of the situation there, which is that the slaughter of the Kurds being done by Turkey is yet another negative consequence of the regime change war we’ve been waging in Syria,” Ms. Gabbard said.

Despite the shared military service of Ms. Gabbard and Mr. Buttigieg, the two veterans split over whether to keep American troops in Syria.

Mr. Buttigieg said that Ms. Gabbard was “dead wrong,” and that the slaughter was not caused by the presence of American troops but by the abrupt withdrawal of troops by the Trump administration.