By John Whitesides and Simon Lewis

WASHINGTON (Reuters) - Democratic presidential contenders on Friday condemned the air strike that killed Iranian military commander Qassem Soleimani, saying President Donald Trump's decision was reckless and could lead the United States to another war in the Middle East.

"President Trump just tossed a stick of dynamite into a tinderbox," said former Vice President Joe Biden. His campaign released a 30-second online ad that portrayed Biden as "tested and trusted around the world" against Trump's "erratic, unstable" presidency.

"We're on the brink of yet another war in the Middle East," said liberal U.S. Senator Elizabeth Warren. "We're not here by accident. We're here because a reckless president, his allies and his administration have spent years pushing us here."

The overnight killing of Soleimani, regarded as the second most powerful figure in Iran, was a dramatic escalation of hostilities in the Middle East between Iran and the United States and its allies.

A protracted conflict could reshape an election that has so far been dominated by domestic issues, such as healthcare and money in politics, strategists said. While that could be a plus for the leading Democratic candidates such as Biden, who has stressed his foreign policy experience and credentials, lesser-known contenders could have a harder time being heard.

"The ultimate beneficiary in the Democratic race could be the four candidates in front," said Democratic strategist Steve Elmendorf, referring to Biden, Warren, U.S. Senator Bernie Sanders and Pete Buttigieg, the former mayor of South Bend, Indiana.

"Nobody behind them will have a chance to reset the race or change things," said Elmendorf, a Buttigieg supporter who served as chief of staff for former House Democratic leader Dick Gephardt.

The Democratic contenders are set to face voters for the first time in a month, when Iowa kicks off the state-by-state nominating battle on Feb. 3.

Public opinion polls show Americans in general are opposed to U.S. military interventions overseas. A survey last year by the Chicago Council on Global Affairs found only 27% of Americans believe military interventions make the United States safer, and nearly half said they make the country less safe.

"There are serious questions about how this decision was made and whether we are prepared for the consequences," said Buttigieg, a former Navy Reserve officer who served in Afghanistan.

Trump said the strike aimed to disrupt "imminent and sinister attacks" on Americans. His fellow Republicans praised the president for restoring American strength and leadership.

"At a time when the president is under impeachment by the Democrats, there's nothing wrong with him showing strength and resolve in the face of a foreign threat," said Republican strategist Ron Bonjean, who is close to the White House.

While the Democrats were united in condemning Trump's decision, there were some distinctions in their responses. Biden and Buttigieg indicated they viewed Soleimani as a security threat who had sowed chaos in the region, whereas Sanders and Warren referred to him more neutrally and called his killing an "assassination."

Sanders, who has consistently opposed U.S. military intervention overseas, contrasted the strike with his own domestic priorities of universal healthcare, improved infrastructure and steps to combat climate change.

"We must invest in the needs of the American people, not spend trillions more on endless wars," Sanders said at a campaign event in Anamosa, Iowa.

Sanders also mentioned his 2002 vote against authorizing war in Iraq, which he frequently uses as a contrast to Biden, the former chairman of the Senate Foreign Relations Committee, who backed the war.

Tulsi Gabbard, a House member and Army National Guard veteran of the Iraq war who also has opposed U.S. military interventions, said the strike showed "we need to get out of Iraq and Syria now."

"That is the only way that we're going to prevent ourselves from being dragged into this quagmire, deeper and deeper into a war with Iran," she wrote on Twitter, using the hashtag #WWIII.

(Additional reporting by Steve Holland; Editing by Steve Orlofsky and Jonathan Oatis)