President Trump’s most positive foreign policy legacy will lie in the greater Middle East: the normalization agreements between Israel and three Arab states; the overrunning of the Islamic State’s territory in Syria and Iraq; and the peace accord between the United States and the Afghan Taliban. After all, what else is there? His “maximum pressure” campaigns to disarm North Korea and democratize Venezuela failed, as did the attempt to use tariffs to force China to abandon mercantilism. Relations with close U.S. allies in Europe are in ruins.

Yet even in the Middle East, there’s a bigger and more negative story. The real bottom line of Trump’s policies there was revealed not at the hyped-up White House ceremony in September featuring Israeli, Bahraini and United Arab Emirates leaders, but at an Oval Office meeting 10 days ago, at which the president asked advisers about bombing Iran. His grasp at that straw — which the national security team quickly rejected — showed how the overarching strategy that Trump has pursued for the past four years has led to a disastrous dead end.

In its essence, Trump’s Mideast gambit was to tightly align the United States with Israel, Saudi Arabia and other Arab Sunni states, then join with them in a relentless campaign against Shiite Iran. Trump was intent on repudiating the nuclear accord with the Islamic Republic, because it was President Barack Obama’s signal foreign policy achievement; he was seduced in his first trip abroad by sword-dancing Saudi leaders, who he wrongly supposed would purchase hundreds of billions in U.S. arms; and he was anxious to please U.S. evangelical Christians, for whom Israel is a sacred cause.

The policy has failed in every respect. Despite heavy sanctions and the assassination of its top general, the Iranian regime has neither collapsed nor reduced its aggression across the Middle East. Its militias were still firing rockets at the U.S. Embassy in Baghdad last week. Following Trump’s abrogation of the nuclear accord, Tehran stepped up its production on enriched uranium and now has 12 times more than it did when Trump took office — enough for a couple of warheads. That advance prompted Trump’s feckless and futile inquiry about bombing — which, his advisers told him, could trigger a regional war during his last days in office.

Trump’s tight alignment with the Saudis led him to excuse their mounting foreign aggression and domestic repression, from the criminal bombing of schools and markets in Yemen to the murder and dismemberment of exiled journalist Jamal Khashoggi. His unquestioning support for right-wing Israeli Prime Minister Benjamin Netanyahu caused him to endorse a grotesquely one-sided “peace plan” for Israel and the Palestinians that served only to sever relations between them.

Perhaps most significantly, Trump accomplished the opposite of what he said he wanted when he ran for president: to extricate the United States from the Middle East and its “endless wars.” Obama had the same goal, and the accord with Iran was integral to it: The idea was to forestall the largest potential threat to the United States and to Israel — an Iranian nuclear arsenal — then promote a equilibrium in the region between Iranian-led Shiites and Saudi-led Sunnis.

Trump restored the threat of an Iranian nuke, encouraged the sectarian war Sunni and Shiite extremists wanted, and then fully aligned the United States with the Sunni side, making disengagement from the region impossible. He ended up sending thousands more U.S. forces to the Middle East to defend oil fields and tankers from Iranian attacks, and despite an 11th-hour drawdown, he has had to leave American forces in Iraq and Syria.

The accords between Israel and Arab states were the silver lining of this disaster: The U.S.-backed anti-Iran alliance brought the Jewish and Arab states together. But if Trump had kept the United States on the sidelines, the rapprochement would likely have happened anyway. After all, Arab states have drawn closer to Israel, the local superpower, precisely to hedge against a U.S. withdrawal from the region.

So what does President-elect Joe Biden do with this mess? First, he will want to remember the mistakes he and Obama made on their watch — above all, wrongly judging an Israeli-Palestinian peace deal to be the key to the region, and making it a priority despite the manifest unwillingness of the current leaders on both sides. But then he ought to revive Obama’s equilibrium strategy, which allows the United States to align itself against the aggression and human rights abuses of both Iran and Saudi Arabia, while gradually making the pivot away from the Mideast the past two presidents aimed for.

The first step: Don’t bomb Iran. Last week, Iranian Foreign Minister Mohammad Javad Zarif said Tehran would return with “no negotiations and . . . no conditions” to the previous constraints on its nuclear activity if Biden lifted the sanctions Trump imposed. That’s worth exploring.

Read more: