The U.S. strike in Baghdad that killed a top Iranian general, Qassem Soleimani, thrust foreign policy to the center of the Democratic presidential race, drawing expressions of grave concern from the leading candidates and stoking a new debate in the party about the U.S. military presence in the Middle East.

The party’s presidential field reacted to the attack with a measure of unity, at least on the surface level, condemning Soleimani’s role directing violence against Americans but criticizing what they called the Trump administration’s penchant for reckless action and the threat of all-out war.

But during a series of campaign events Friday, the top Democrats began to signal their differences on matters of national security, opening the way for what could become the party’s most serious conversation of the race about war and peace. Former Vice President Joe Biden, whose long diplomatic résumé and global stature have been seen as crucial assets to his campaign, seized the occasion to remind voters of his experience, pressing them to elect a president who could “command the world stage with no on-the-job training.”

Delivering stern remarks in Dubuque, Iowa, Biden said President Donald Trump was risking nuclear proliferation and “direct conflict with Iran.” On Twitter, he described the president as “erratic, unstable and dangerously ­incompetent.”

“The threat to American lives and interests in the region and around the world are enormous,” Biden said in Iowa.

But elsewhere in the state, Sen. Bernie Sanders, I-Vt., called not just for the replacement of an impulsive president but for a wholesale overhaul of U.S. foreign policy in the Middle East. At a town-hall-style meeting in Anamosa, Sanders urged a total military pullback from the region and noted at length that he had forcefully opposed the 2003 invasion of Iraq, without explicitly mentioning that Biden had voted to authorize the war.

“We need to firmly commit to ending the U.S. military presence in the Middle East in an orderly manner, not through a tweet,” Sanders said, reiterating his past calls for a pullout from Afghanistan and an end to cooperation with Saudi Arabia’s war in Yemen. “Instead of provoking more volatility in the region, the United States must use its power, its wealth and its influence to bring the regional powers to the table to resolve conflicts.”

And Sen. Elizabeth Warren, D-Mass., who in the past has urged a pullout of all U.S. combat troops from the Middle East, echoed that sentiment on Twitter, warning that the country was “on the brink of yet another war” and urging Americans to mobilize against military escalation. “No more Middle East Wars,” she wrote.

Both Sanders and Warren used the word “assassination” to describe the killing of Soleimani, a term that has significant legal and diplomatic implications. One of the prominent centrists in the race, Michael Bloomberg, rebuked Sanders for that description, calling it “outrageous.” He described the felled general as a fair target, questioning instead whether Trump was prepared for the fallout.

Whether military matters come to dominate the primary in the remaining month before the Iowa caucuses is likely to depend on events in Iraq and Iran — and perhaps in neighboring countries — and how severe and visible any ensuing clash with Iran turns out to be. Foreign affairs have so far played a strictly limited role in the Democratic race.

There have been major debate-stage duels over health care, taxation, immigration, criminal justice and gun control, but only glancing disagreements about the role of the United States abroad and the proper way to resolve U.S. military engagements in the Middle East and Central Asia.

On Friday, much of the Democratic field proceeded with — and recommended — caution. Sen. Amy Klobuchar, D-Minn., called on the Trump administration to consult with Congress about a “strategy for preventing a wider conflict.”

And in North Conway, N.H., Pete Buttigieg — the former mayor of South Bend, Ind. — called the Baghdad attack “an extremely provocative act,” noting that Presidents Barack Obama and George W. Bush had both considered but opted against attempting to kill Soleimani.

“If we have learned nothing else from the Middle East in the last 20 years, it’s that taking out a bad guy is not a good idea unless you are ready for what’s coming next,” said Buttigieg, who referred several times to his own service in the military.

At Democratic campaign events Friday, there was already a ripple of anxiety running through the primary electorate as voters who turned out to see several candidates voiced alarm as they imagined what Trump might do next.

“Nobody wants war, and that’s what I am afraid of — is that there is going to be war,” said Brenda Bachman, a 63-year-old from Marengo, Iowa, who had come to see Sanders. “We don’t need war.”