President Recep Tayyip Erdogan is following public attitudes in his country. (AP)
Yoav Fromer teaches American history and politics at Tel Aviv University and Yeshiva University. He is currently at work on a book about Daniel Patrick Moynihan and American liberalism.

Even by Middle East standards, recent weeks have been harrowing. President Trump’s decision to pull out of the Iran nuclear deal and Secretary of State Mike Pompeo’s 12 demands to Tehran, just as Israel and Iran’s conflict in Syria heats up, have raised the prospects of a regional war. Iran scored a major victory in the Lebanese elections after a coalition led by Hezbollah, its militant proxy, secured a parliamentary majority. In Iraq, the firebrand Shiite cleric Moqtada al-Sadr upset the American-backed candidate in recent elections and now heads the nation’s biggest party.

Things got even worse after the United States inaugurated its new embassy in Jerusalem in May and violent protests erupted along the Gaza-Israeli border that left more than 60 Palestinians dead. This sparked a bellicose exchange of accusations between Turkish President Recep Tayyip Erdogan and Israeli Prime Minister Benjamin Netanyahu that culminated in the Israeli ambassador’s humiliating expulsion from Ankara, imperiling relations between two of America’s most important allies in the region.

There’s something that links all these crises: the considerable role of democratic majorities and public support in fueling them.

If there has been one constant in U.S. foreign policy since 1945, it has been the firm belief that the defense and expansion of democracy are aligned with the national interest. That was the rationale for the Truman Doctrine and the Marshall Plan, which aimed to buttress America’s Cold War allies and contain the Soviet Union; later, it became a central pillar of the Bush Doctrine . Although Presidents George W. Bush and Barack Obama disagreed on how to promote democracy, they both thought spreading it was vital to America’s national security.

But recent events in the Middle East suggest otherwise. Far from being the panacea that could save the volatile region from itself, democratization has bred unintended consequences that are tearing it apart. In Iran, Gaza, Turkey, Lebanon, Iraq and even Israel — the only functioning liberal democracy in the area — democracy may be the problem, not the solution. Instead of moderating extremism, the will of the majorities in these countries has been driving it.

Trump ended his televised statement exiting the Iran nuclear deal with a personal appeal to the Iranian public: “The people of America stand with you.” But it’s not clear that all those Iranians stand where Trump thinks they do. Although Iran’s clerical regime brutally stifles dissent, the supreme leader and his hard-line policies enjoy considerable popular support in the Islamic republic’s regular — albeit only partly contested — elections.

Rather than oppose Iran’s nuclear ambitions and the years of crippling sanctions they brought on, large parts of the Iranian public have embraced them. In one Rand Corp. survey from 2011, at the height of the sanctions, 98 percent of Iranians said the possession of nuclear energy is a national right. The sanctions relief that came with the 2015 nuclear deal, the Joint Comprehensive Plan of Action, didn’t change much: A substantial poll by the Center for International and Security Studies at the University of Maryland conducted a few months ago found that a whopping 86 percent of Iranians still considered the development of a nuclear program important for their country, and almost 53 percent thought Iran should pull out of the deal or restart its nuclear program if the United States withdrew. Similarly, more than 60 percent of respondents affirmed that Iran’s interventions in Syria and Iraq were in their country’s national interest, and nearly 95 percent said it was important for Iran to develop its missile program. When it came to America, more than 93 percent had unfavorable opinions of the U.S. government (Hezbollah, by comparison, had almost 65 percent favorability).

Trump, like many Western leaders, seems to believe that if only the ayatollahs were toppled, Iranians would embrace America, give up the nuclear program, halt missile development and cut terrorist ties. But even if some respondents understandably hesitate to criticize the regime out of fear, large parts of the Iranian public have consistently endorsed the programs that have led to international isolation. Despite the internal Iranian divisions over economic policy, corruption and civil liberties, the nuclear program remains a rare source of unity.

In Gaza, the will of the majority has proved equally harmful. Although Hamas certainly doesn’t qualify as a democratic movement, it came to power in a sweeping victory in the 2006 Palestinian parliamentary elections. Despite brutalizing many of its own citizens, despite the grave humanitarian crisis in Gaza, despite the poverty and degradation in which most Gazans have lived since Israel and Egypt imposed a blockade in response to Hamas’s 2007 coup against the ruling Palestinian Authority, it continues to enjoy considerable public support as result of its fight against Israel.

Lacking any genuine governing achievements, Hamas retains legitimacy because of its ability to rain down rockets on Israeli towns and conduct terror raids through its tunnel system. And conflict has clearly paid off: In the wake of each of its devastating wars with Israel (in 2009, 2012 and 2014), Hamas experienced a resurgence of popular support among Palestinians. This dynamic explains the current spasms of violence, too. One recent poll, conducted by the Tami Steinmetz Center for Peace Research after Trump’s formal recognition of Jerusalem as Israel’s capital, found that only 26 percent of Palestinians still supported a peace deal with Israel (a sharp drop from 45 percent last June), while 38 percent endorsed armed struggle — a spike from previous surveys. Given that most Gazans have traditionally endorsed violence against Israel, Hamas’s growing intransigence and willingness to risk war by waging mass demonstrations and firing rockets at Israeli towns might be expressions, rather than distortions, of the public will. Israeli officials say Hamas forced civilians to participate in the recent protests, but given Gazans’ desperation, it might be that mounting public pressure and discontent forced Hamas to instigate the demonstrations.

While Netanyahu is often cast as an obstacle to peace — reportedly even by Trump — he is merely reflecting the rightward drift of the Israeli public. Less than a decade ago, he endorsed a two-state solution and reached out to the Palestinians, but now he no longer pays even lip service to such notions. A clear majority of Israelis — as many as 70 percent, according to one poll — prefer a right-wing government. Accordingly, it appears that most of them have given up on the peace process: Only 38 percent say a peace deal should still be sought with the Palestinians, and two-thirds of Jewish Israelis don’t consider the West Bank — the contested lands conquered by Israel in the 1967 war — to be occupied territories. Constantly hounded on his right flank, Netanyahu has effectively lost any domestic incentive to moderate. What’s more, his combative stance toward Iran and Hamas, and his successful efforts to move America’s embassy to Jerusalem, have diverted attention away from his alleged bribery scandals and lifted his standing: New polls have seen his popularity skyrocket and suggest that his Likud party would grab at least 35 seats in the Knesset if elections were held today (as late as April, he was polling at 28 seats).

When Erdogan excoriated Israel for being an “apartheid state” and praised Hamas after the cross-border violence last month, the Turkish president was similarly responding to public sentiment. While commentators explained Erdogan’s attacks as part of a political ploy to garner votes in the parliamentary elections in June, it is telling that it works: Although Erdogan long ago left behind the legitimate democratic leader he was when first elected prime minister 15 years ago — he is now basically a modern-day sultan who has centralized power and neutralized any serious opposition — he still needs to compete in relatively open elections. And he can bash Israel and extol Hamas exactly because he knows he will be rewarded by voters for doing so. In an astounding 2014 poll, the Pew Research Center found that a vast majority of Turks disliked Israel more than the Islamic State, Hamas or Hezbollah; while 86 percent of Turks held unfavorable views of Israel, only 2 percent had favorable ones.

Two important recent elections also spell bad news for the United States. Hezbollah’s victory in the Lebanese parliamentary balloting nearly a month ago means that most Lebanese voters aren’t all that interested in efforts by the West to block Iranian influence in their country or disarm Hezbollah. The Iraqi election results that came in a few days later were equally discouraging: Sadr, whose Mahdi Army ferociously battled American troops during the war, has now become the kingmaker of Iraq’s next government by securing the largest number of seats in parliament. Iraqi Prime Minister Haider al-Abadi, whose party finished a disappointing third, called the elections “a remarkable victory for democracy.” He is right. But that doesn’t mean they were a victory for American interests in the region.

Meanwhile, the main source of stability in the Middle East remains the dictatorships and monarchies where the popular will has little impact on government policy. The only governments that openly maintain stable relations with Israel are Egypt, Jordan and the Palestinian Authority (Saudi Arabia has also cooperated with Israel through back-door channels to curtail Iranian influence). Unlike the short-lived democratic government in Egypt, headed by the Muslim Brotherhood’s Mohamed Morsi, that threatened to review the 1979 peace agreement with Israel, the general-turned-president Abdel Fatah al-Sissi maintains peace with the Israelis exactly because he doesn’t have to answer to the Egyptian public, which remains overwhelmingly hostile to the Jewish state.

Theorists and policymakers long thought that dictators like Hafez al-Assad in Syria or Saddam Hussein in Iraq were the cause of regional instability. But since the Arab Spring, there appears to be a growing gap between moderate, Western-oriented autocrats like Sissi, Jordan’s King Abdullah II and Saudi Crown Prince Mohammed bin Salman, and the majority of their citizenry that pulls in the opposite direction. Motivated by deeply rooted historical, economic, cultural and religious grievances, large majorities throughout the Middle East are hostile to the United States and Israel. Democracy and self-determination are, in most circumstances, salutary goals to be pursued and promoted. But in the Middle East right now, they are also catalysts for regional conflict.

Unlike his predecessors, Trump has never carried the mantle of democratization. But he might soon have to deal with the unexpected consequences it poses. The particular form of government taking root in the Middle East — majoritarian rule without liberal institutions — has not made it any more safe or stable. Instead of imagining how to spread democracy in the region, the United States may soon begin thinking about how to contain it.

Read more from Outlook and follow our updates on Facebook and Twitter.