Democratic presidential candidates weigh in on tensions with Iran They would handle the matter differently if they were in the Oval Office.

Many of the 23 Democratic candidates vying to take on President Donald Trump in the 2020 election are in agreement that a strike on Iran would lead to devastating consequences and the administration's decision to pull out of the Iran nuclear deal is to blame for the escalating tensions between the United States and the Middle Eastern country.

Trump said in a series of tweets Friday that he called off an attack on Iran with just 10 minutes to spare Thursday night, saying the civilian casualties that would have occurred would not have been a "proportionate" response to the Iranians shooting down an unmanned U.S. drone late Wednesday. Iran claimed the drone was flying in its airspace, but the U.S. government disputed that, saying it was flying in international airspace. Trump's reversal on the strike was against the advice of Secretary of State Mike Pompeo and national security adviser John Bolton, sources told ABC News.

The plan and reversal was first reported by The New York Times.

While most of the Democrats running for president expressed concern about what they see as the Trump administration escalating tensions with Iran, the candidates differed on how they would handle a similar situation if they occupied the Oval Office, what impact military action could have and whether they would support re-entering the Iran nuclear deal.

What they would do if they were president

Massachusetts Rep. Seth Moulton, a former U.S. Marine who served in Iraq, told ABC News he would respond to Iran striking down a U.S. drone "by simply turning off the power to the grid in the southern part of Iran," adding on Twitter that he would target that area because it’s "where the missile system is located."

"It would be a very clear decisive response but it wouldn't escalate things to the point where Iran would have a justification for escalating things further," he said in a phone interview with ABC News.

Moulton also said he would use this situation "as an opportunity to reopen diplomatic engagement, especially with our European allies who right now are trying to go around us and our secondary sanctions."

South Bend, Indiana Mayor Pete Buttigieg, who was deployed to Afghanistan in 2014 as a Navy Reserve intelligence officer, also said he would "respond by engaging our allies."

"We would also need to respond by signaling that Iran needs to stop with provocations, but do it in a way that demonstrates our understanding that this cannot be allowed to escalate into a more and more violent situation," he said during a media availability at the National Association of Latino Elected and Appointed Officials (NALEO) presidential forum in Miami on Friday.

Speaking at the same conference, California Rep. Eric Swalwell said the administration needs to negotiate directly with Iran, as it did with North Korea.

"I submit that (Trump) was right to engage with the North Koreans, wrong to pull us out of the nuclear agreement with Iran," he said at the NALEO forum. "So we should directly negotiate with them, deescalate the tension, but also earnestly show a desire to get back into a nuclear agreement."

Asked on MSNBC Thursday how he would have reacted, Colorado Sen. Michael Bennet said he "would not have blown up the Iran nuclear deal to begin with and jeopardize the alliance that we built to keep Iran`s nuclear program in a box."

Bennet said the United States needs to "respond in a way that protects the national security interests," but when pressed on whether that meant military action, the senator said he didn't want to specify, but that countermeasures are needed.

Concerns about escalation

Multiple candidates warned that military action could lead to another war in the region, with former Colorado Gov. John Hickenlooper saying Trump is bringing the U.S. closer to "a worldwide conflict" not seen since World War II. Former Housing and Urban Development Secretary Julian Castro said Friday at the NALEO forum that he has "no confidence" in the administration deescalating the situation or even faith that it wants to.

Former Texas congressman Beto O'Rourke said on Twitter Thursday that the Trump administration "is gunning for war in Iran," a sentiment shared by New Jersey Sen. Cory Booker who said in a statement Friday that this "march to war" has "no off-ramp."

"This is not reality television, where decisions are made in the pursuit of maximum drama," Booker said. New York Mayor Bill de Blasio echoed his comments, tweeting, “This isn’t a sick ratings game or reality show. Lives are at stake.”

Cautioning against military action

However, the candidates urged caution when it comes to military action.

Vermont Sen. Bernie Sanders said he thinks there are people in both the Trump administration and the Iranian government who want to go to war.

In a tweet Thursday, California Sen. Kamala Harris echoed Sanders' concerns about going to war, writing, "Either the Trump Administration is angling for another disastrous war in the Middle East, or they've spent two years saber-rattling against Iran with no strategy and no endgame. "

In an interview on MSNBC Friday morning, New York Sen. Kirsten Gillibrand said the fact that a retaliatory strike was even considered "is deeply troubling."

"Thank God, he called it off. He has no idea what a first strike would do in this instance. He has no idea what the impact would have been... I have very grave concerns about his ability to protect the country at this point," she said, calling Trump's foreign policy "erratic."

Ohio Rep. Tim Ryan also called the president "erratic" in a tweet Friday, adding that it's "unbelievable that we’re supposed to be relieved he didn’t get us into World War III last night."

Former Maryland Rep. John Delaney said Iran “must be held accountable” for shooting down the U.S. drone if it was over international waters, but did not specify how it should be held accountable.

Asked whether Trump taking military action without congressional approval would be an impeachable offense, Gillibrand, who sits on the Senate Armed Services Committee, said she "would seriously consider that."

A campaign spokesperson for former Vice President Joe Biden, who chaired the Senate Foreign Relations Committee during his congressional tenure, told ABC News Biden thinks going to war with Iran without congressional approval would be "an impeachable offense."

"Vice President Biden believes a war against Iran without authorization from Congress would be unconstitutional. An illegal war that puts at risk thousands of American lives and would bog down the U.S. military in conflict in the Middle East for years would certainly qualify as an impeachable offense," TJ Ducklo told ABC News.

Booker, who also sits on the Senate Foreign Relations Committee, and fellow Sen. Amy Klobuchar of Minnesota, both stressed that Trump needs congressional approval to strike Iran.

"Any military action in Iran that circumvents Congressional approval is a blatant and unconstitutional power grab," Booker said.

The way forward with Iran

Biden, who during the Obama administration helped negotiate congressional support for the Joint Comprehensive Plan of Action (JCPOA), colloquially referred to as the Iran nuclear deal, blasted Trump's decision to leave in a statement Thursday, saying his "Iran strategy is a self-inflicted disaster."

"Trump promised that abandoning the deal and imposing sanctions would stop Iran’s aggression in the region. But they’ve only gotten more aggressive... the predictable has happened: Iran is building back up its nuclear capability," the former vice president said. "Another war in the Middle East is the last thing we need."

"What we need is presidential leadership that will take strategic action to counter the Iranian threat, restore America's standing in the world, recognize the value of principled diplomacy, and strengthen our nation and our security by working strategically with our allies," Biden said.

Castro, Klobuchar, former Maryland Rep. John Delaney and others called Trump leaving the Iran nuclear deal a “foreign policy failure.”

“Withdrawing from the Iran agreement, alienating our allies, and ramping up the pressure on Iran without a clear strategy has created an inherently dangerous situation in the region and is a foreign policy failure by the Trump administration,” Delaney said.

Others want to return to the deal.

Tech entrepreneur Andrew Yang said on Twitter Thursday that he would "pursue diplomatic solutions."

"We need to return to that agreement and once again work with our allies to achieve this goal – rather than being driven toward war by the chaos and dysfunction of the Trump Administration," Washington Gov. Jay Inslee said in a statement Friday.

Hawaii Rep. Tulsi Gabbard, an Iraq War veteran, who in February defended her non-interventionist foreign policy stance in an interview on ABC's "The View," took to Twitter Friday and said in a posted video that "war with Iran is highly likely unless Trump swallows his pride and returns to the Iran nuclear agreement that he tore up."

ABC News' Armando Garcia, Cheyenne Haslett, Adam Kelsey, Molly Nagle, Lissette Rodriguez and Zohreen Shah contributed to this report.