This past weekend's dramatic escalation of tensions between Iran and the United States, instigated by the Trump administration's capricious decision to assassinate Quds Force Gen. Qassem Soleimani in Baghdad, has rightfully sparked concerns about war, accidental or intentional. These fears are not idle. While President Trump seems to share his predecessor's basic desire to minimize America's strategic presence in the Middle East, his deranged loathing of Iran together with his lifetime of wronging other people without any consequences, threatens to plunge America into a war that no one seems to want.

How did a president personally opposed to Middle East wars get us to this point?

Let's rewind first to the end of the Obama administration. When Trump entered office, the Joint Comprehensive Plan of Action (JCPoA), better known as the Iran nuclear deal and passed over the squawking and mostly bad-faith opposition of the Republican Party, was less than two years old and was working as intended, even if it had not led Iran to alter its policies in other parts of the region. Iran had dismantled or shuttered significant nuclear sites and allowed the International Atomic Energy Agency (IAEA) full access for inspections and monitoring. While the deal had some so-called sunset provisions, it significantly extended Iran's "breakout time" to build a nuclear weapon should the accord fall apart, and promised more than a decade of nuclear stability.

Obama's strategy with Iran had been to avoid what is known as issue linkage. In other words, his administration worked hard to resolve the nuclear dilemma while more or less bracketing the Islamic Republic's support for the regime of Bashar al-Assad in Syria, its sponsorship of the Lebanese militia and political party Hezbollah, and its increasingly unsubtle grip on Iraqi politics. The Obama administration either regarded these problems as beyond the potential of diplomacy to resolve and outside America's fundamental security interests, or believed that establishing a functional relationship in one domain might eventually lead to the possibility of a future breakthrough in others.

President Obama himself obviously looked at America's involvement in the region as a distraction from more important business. And because he was willing to challenge decades-long orthodoxy about Iran as well as a particular Beltway think-tank reading of America's role in regional security, he was disliked by most of the region's major players, including the Saudis, the Egyptians, and the Israelis. But he failed to fully execute his planned pivot, perhaps in part because he didn't appoint any clear non-interventionists as top advisors or Cabinet officials.

Obama authorized the U.S.-led NATO intervention to depose Libyan strongman Moammar Gadhafi, a questionable policy which led to ongoing state failure and in a roundabout way, destroyed the presidential aspirations of his designated successor. To placate the Saudis as he negotiated the Iran nuclear deal, he also green-lit and equipped Riyadh's disastrous intervention in the Yemeni civil war, a quagmire into which Tehran then eagerly waded. And having executed America's withdrawal from Iraq, he chose to send fresh forces to prevent Baghdad from falling into the hands of ISIS.

By the end of his two terms, America's footprint in the region was smaller, the risk of open war with Iran significantly reduced, and the specter of an Iranian nuclear weapon greatly diminished. But Obama left the incoming Trump administration with a number of problems and conundrums, as well as critical decisions to make. Despite the modest improvement in U.S.-Iran relations, the Yemen quagmire had brought Saudi Arabia and Iran to the brink of disaster. Twin humanitarian calamities continued to unfold in Syria and Yemen with no end in sight. And the United States now had forces in Syria and Iraq as part of the fight against ISIS — not to mention the forever war in Afghanistan. Obama had eight years to get the U.S. out of the Middle East, and he couldn't do it. Could Trump?

The situation facing America's new president, a former reality TV star whose policy acumen could charitably be described as thinner than a sheet of aluminum foil, would have bedeviled even a sober and well-meaning person committed to the long-term drawdown of American military oversight of the Middle East. President Trump, on the other hand, is Obama's opposite in nearly every regard. Petulant, impulsive, and ill-informed, the president approached the Middle East with a bizarre and completely irreconcilable set of principles. On the one hand, he desperately wanted to avoid launching new wars, and if possible, to wind down commitments in Syria and Afghanistan. The Iraq War had decisively (and rightly) soured voters on regional interventionism, and Trump at least had a showrunner's sense that people wanted a dramatic departure from 40 years of costly American policy failure in the Persian Gulf.

At the same time, his childish opposition to the Iran Deal, based on little except unhinged personal animus for Obama and misinformation gleaned from right-wing agitprop, allowed the Saudis and Israelis to steer him into immediate confrontation with Tehran. He also, strangely, surrounded himself from the beginning with Iran hawks of varying levels of lunacy and neoconservatives who had spent the past eight years calling Obama's regional policy weak and feckless. The few mainstream Republican foreign policy hands willing to work for him also shared the think tank consensus that the exercise of American military power is often necessary to secure the stability of the region.

Yet like with all things Trump, the end result of these competing impulses has been a puzzling mishmash whose consequences will be felt more in the long run than they are today. The president ostentatiously announced troop withdrawals from Afghanistan without really bringing the war to an end. He crows about defeating ISIS but seems oblivious to the painstaking diplomatic work that contributed to it. He staged pointless stunts like moving the U.S. Embassy in Israel from Tel Aviv to the disputed city of Jerusalem. He can barely conceal his affinity for Saudi excellencies and dispatched his know-nothing son-in-law Jared Kushner as perhaps the least effective and respected envoy in the history of American diplomacy, mostly to hold conferences and initiatives that wouldn't make the B-stage at a TEDx conference. He has thus far avoided further catastrophe that could clearly be laid at his feet only because the region is already in flames.

Most dangerously, jettisoning the Iran deal in 2018 set off a chain of tit-for-tat provocations that has left the two countries arguably one step — an Iranian retaliatory attack on American military assets or civilians — away from total war. Officials routinely admit to reporters that there is no process behind the Iran blundering. Not only does the Trump team not seem to understand that their initiatives have been unsuccessful in bringing Iran to the negotiating table, they continue to operate with a blithe disregard for the risk of broader conflict.

The most gracious spin you could possibly put on the Trump administration's Iran policy is that they believe the risk of direct conflict is worth taking to rein in Iranian meddling in other regional states, and that only a madman's rhetorical posture can convince Tehran to attend new talks. The only thing they are getting right in Trumpworld, however, is the part where they seem unglued and unstable — see, for example, President Trump's recent threat to the commit the war crime of destroying Iran's culture heritage.

But it gets worse. President Trump has now thoroughly alienated and possibly destabilized the Iraqi government, just months after pulling a volte face and abandoning America's Kurdish allies in the fight against ISIS. The U.S. will likely find it almost impossible to stitch that anti-ISIS coalition back together should another Salafi-Jihadist organization rise to menace the region. If Iraq collapses again, there will be no one there to pick up the pieces save for the Iranians. And this reckless act of war has likely smothered for now the growing anti-regime protest sentiment across the country by uniting Iranians once again against the U.S.

Imputing rational motives to President Trump is like engaging in political anthropomorphism, but you do have to ask what he thinks he's getting out of any of this and how it will benefit him. Does he expect Iranian Supreme Leader Ali Khameini to suddenly decide to invite President Trump to Tehran? Have his Cabinet hawks convinced him that the theocracy is just one more shock away from collapse? Is this all an example of what international relations scholars call The Diversionary Theory of War, designed to distract the public from impeachment? Or are we just staggering drunkenly from one disaster to the next, our policy driven by presidential mood swings and Trump's decades-long success at avoiding even the barest consequences of his contemptible actions?

Maybe the answer to all of those questions is "yes."

Want more essential commentary and analysis like this delivered straight to your inbox? Sign up for The Week's "Today's best articles" newsletter here.