War with Iran has been coming at us in slow motion since 1979. Now, ominously, it’s really here, but we don’t seem any better at deflecting revolutionary Iran from its destructive course than we were at the beginning.

The Iranian-backed militiamen with their battering ram at the gate of the U.S. Embassy in Baghdad on Tuesday looked eerily similar to the well-directed mob that seized the U.S. Embassy in Tehran and set this dreadful story rolling. In the 40 years since then, journalists like me have written about the “brink of war” in the Persian Gulf so often that we ought to have the phrase on a function key. But there was never a direct, acknowledged act of war until Thursday night.

Maj. Gen. Qasem Soleimani, the head of Iran’s Quds Force, deserved his fate. He was a ruthlessly clever commander who threatened the United States and its allies for two decades. For more than a year, Soleimani and his colleagues had been ignoring U.S. signals to cease proxy attacks against U.S. facilities that could result in American deaths. The last message was a fireball that Soleimani probably never saw coming, literally or figuratively.

For all his television swagger and belligerence, President Trump had been fairly restrained in his military actions against Iran, until last week. But when an American contractor was killed Dec. 27, the U.S. retaliated by killing 25 members of an Iranian-backed militia; the militia counter-retaliated by assaulting the U.S. Embassy; and Trump double-doubled down by ordering the killing of Soleimani, supposedly to prevent further proxy attacks.

This is how wars begin, with a chain of missed signals and tit-for-tat responses. Trump’s initial restraint was perceived in Tehran as a sign of weakness; Iran’s economic troubles and civil strife were seen in Washington as a sign that Iran would capitulate to pressure and begin negotiations.

Up the ladder the two sides went — neither with a clear strategy for an endgame, it seems. The question now is the same as in any war, memorably stated by Gen. David H. Petraeus during the 2003 invasion of Iraq: Tell me how this ends.

It’s as though the Middle East has played a cruel joke on Trump. The president who wanted so badly to escape the region that he abandoned a low-cost, high-success mission in northeast Syria is now stumbling into a hugely expensive adventure against Iran. He has lurched from one ill-considered policy to the next, goaded by advisers for whom Iran seems more an obsession than a strategic target.

The collateral damage is likely to include Iraq, with which the United States had built a fledgling partnership that destroyed the Islamic State and was perhaps on the way to rebuilding a coherent Iraq. That project may be doomed; if the American connection is severed, Iraq may implode once more, further destabilizing the region.

The lack of a coherent strategy for containing Iran’s revolutionary mayhem began long before Trump. Norman T. Roule, a senior former intelligence official who oversaw Iran operations for two presidents, told me today: “My fear for several decades has been that in the absence of a clearly understood ‘red line,’ we would risk the very conflict that we hoped to avoid.”

Some inherent stabilizing factors remain. Neither Iran nor the United States wants a cataclysmic war that would leave both sides worse off. Each nation has a professional military that is deeply suspicious of the ideological projects that its political leaders propose. Each has Middle East partners that are exhausted by the region’s wars and corruption. Each is heading into an election season in which war is a political loser.

Iran drives the United States to extremes. To free hostages, Presidents Jimmy Carter and Ronald Reagan both tried covert operations that went badly awry. To subvert the Iranian nuclear program, Presidents George W. Bush and Barack Obama launched a computer virus known as Stuxnet that inaugurated modern cyberwar.

And now, Trump has entered a new era of warfare by openly authorizing the killing of a military leader of another nation, using an armed drone. If you don’t think that will happen again, somewhere else, you may be missing the most important unintended consequence of Thursday’s attack in Baghdad.

Soleimani was an iconic figure, but he was replaced as commander of the Quds Force within a day, and the destructive, destabilizing power of the Iranian revolution — a menace that has ensnared five American presidents — continues. Each time we think we’ve found the antidote, we seem to open a new chapter that’s even worse.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.