President Trump showed restraint in responding to Tehran’s downing of an American drone six months ago, calling off U.S. military attacks on a number of targets in Iran at the last minute.

Trump also didn’t attack when it was clear Iran was responsible for explosions that disabled two oil tankers in the Gulf of Oman last June, though he ratcheted up sanctions and cyberattacks and sent more troops to the region instead. He again didn’t go on the military offensive when a drone fleet that U.S. intelligence identified as Iranian proxies in Yemen launched a damaging assault on the Aramco oil facility in Saudi Arabia in mid-September.

Over the last two months, the Iranian regime became even more aggressive, attacking nearly a dozen times Iraqi air bases where U.S. military and civilian personnel were operating. When a U.S. contractor was killed days ago in one of those bombings, it crossed the line for Trump and he ordered airstrikes against the Iranian proxy militia responsible.

But few could have predicted the tumultuous events that followed and just how much the game was about to change for Trump and his Iran policy.

When members of that Iranian-controlled militia, Kataib Hezbollah, threatened another Benghazi-like attack on the U.S. Embassy in Baghdad amid taunts from Iran’s supreme leader, Ayatollah Khamenei, Trump responded Thursday night by ordering an airstrike near the Baghdad airport that killed Iran’s most powerful general, Qassam Soleimani, head of the elite Quds Force.

Soleimani, the Pentagon said in statement, was “actively developing plans to attack American diplomats and service members in Iraq and throughout the region.” Thursday’s U.S. airstrike also killed Abu Mahdi al-Muhandis, an adviser to Soleimani and deputy commander of Iran-backed militias in Iraq known as the Popular Mobilization Forces.

The overnight attack stunned Americans and U.S. allies alike even as defense hawks and Trump’s allies praised the move as decisive and fitting because U.S. intelligence had determined Soleimani approved the raid on the embassy and was planning more attacks on Americans.

Trump’s supporters highlighted Soleimani’s role in killing an estimated 600 Americans over the course of the Iraq War, labeling him a chief architect of Iran’s terrorist activity throughout the region.

James Carafano, a leading national security expert at the Heritage Foundation who also served as on Trump’s presidential transition team, called the airstrike that killed Soleimani and his cohorts a “bold and decisive military action made possible by excellent intelligence and the courage of America’s service members.”

“This strike against one of the world’s most odious terrorists is no different than the mission that took out Osama bin Laden – it is, in fact, even more justifiable since he was in a foreign country directing terrorist activities against Americans,” he said. “His death is a huge loss for Iran’s regime and its Iraqi proxies, and a major operational and psychological victory for the United States.”

But even Trump backers were warning of likely consequences as Khamenei and other Iranian officials vowed retaliation. Tucker Carlson, the host of Fox News’ top-rated show, said it appears that America is now “lumbering toward a new Middle East war, a war that many in Washington have wanted for decades.” Those advocates for war in Iran, he said, epitomized by former national security adviser John Bolton, are the same leading Washington national security experts who turn a blind eye toward the “invasion from the South” -- the threat of unchecked illegal immigrant entering the country from Central and South America.

“Pay no attention to that, these very same people tell us. The real threat is Iran. Well, they’re liars,” Carlson said. “They don’t care about you. They don’t care about your kids. They’re reckless and incompetent. And we should keep all of that in mind as war with Iran looms closer tonight.”

The killing of Iran’s top military leader also shifts Trump’s foreign policy agenda to the forefront in a presidential campaign where health care and impeachment were previously the main driving factors.

Democratic presidential candidates denounced the airstrike that killed Soleimani Thursday night, with Joe Biden deriding it as a “hugely escalatory move” in the region. Even though Biden said the leader of Iran’s elite Quds force deserved justice, he argued that “President Trump just tossed a stick of dynamite into a tinderbox.”

“We could be on the brink of a major conflict across the Middle East,” he said in a statement.

Biden himself is highly vulnerable on the issue both for his vote in favor of the U.S. invasion of Iraq and for leading the Obama administration’s efforts to withdraw all American troops there, a decision that left a security vacuum the Islamic State exploited.

Sen. Elizabeth Warren, who was not in Congress during the run-up to the Iraq War, called the move a “reckless” escalation.

“Soleimani was a murderer, responsible for the deaths of thousands of Americans,” she said in a statement shared on Twitter. “But this reckless move escalates the situation with Iraq and increases the likelihood of more deaths and new Middle East conflict. Our priority must be to avoid another costly war.”

Sen. Bernie Sanders issued a similar dire warning: “Trump’s dangerous escalation brings us closer to another disastrous war in the Middle East that could cause countless lives and trillions more dollars.”

“Trump promised to end endless wars, but this action puts us on another path to one,” tweeted Sanders, who voted against the invasion of Iraq while serving in the House.

More centrist Democratic candidates were also highly critical, with Sen. Amy Klobuchar warning about “the timing, manner and potential consequences of the administration’s actions and concerns about an escalating conflict.”

“Our immediate focus needs to be on ensuring all necessary security measures are taken to protect U.S. military and diplomatic personnel in Iraq and throughout the region,” she said. “The administration needs to fully consult with Congress on its decision-making, response plans, and strategy for preventing a wider conflict.”

But the bold military action also received cautious praise from some unexpected GOP corners.

Sen. Mitt Romney, a frequent Trump critic on the right, tweeted that Soleimani “was a depraved terrorist who had the blood of hundreds of American servicemen and women on his hands, and who was doubtlessly planning operations to further harm our citizens and allies.”

The 2012 GOP presidential nominee also praised the “brave troops and intel officers who carried out this successful mission.”

“At this time of increased tension in the region, the U.S. must take necessary steps to protect our personnel there and beyond,” he continued, calling on the administration and U.S. allies to “articulate and pursue a coherent strategy for protecting our security interests in the region.”

In the hours after ordering the attack, Trump let Defense Secretary Mark Esper do the talking.

Appearing on NBC News, Esper condemned Iran’s malign behavior that he said “they’ve been spreading across the region from Africa all the way through the Middle East into Afghanistan now, for 40 years.”

In a broader statement on Twitter directed to “Iran & its proxy militias,” Esper said the U.S. “will not accept continued attacks to our personnel & forces in the region.”

“Attacks against us will be met w/responses in the time, manner, & place of our choosing. We urge the Iranian regime to end malign activities.”

Earlier in the day, Esper told reporters that the Pentagon was ready to take military action to pre-empt future attacks on Americans in Iraq.

“The game has changed and we’re prepared to do what’s necessary to defend our personnel and our interests and our partners in the region,” he said.

Unusually quiet on Twitter, Trump simply tweeted an image of the American flag minutes before the Pentagon publicly said it was responsible for Soleimani’s death.