Quietly since 2002, several Sunni Arab rulers have shifted away from their long-standing hostility toward Israel to focus on the threat posed by Iran.

They have acted in accordance with the Arab Peace Initiative, also known as the Saudi peace plan, which called on the Arab League to terminate belligerency with Israel. It also envisioned a comprehensive peace agreement with Israel in exchange for Israel withdrawing to the June 4, 1967 lines and agreeing to “a just solution to the Palestinian refugee problem” that accorded with “UN General Assembly Resolution 194 while rejecting all forms of patriation.”

Israel refused to accept the resettlement of millions of Palestinians and their descendants, which has obscured how this public gesture represented a radical departure from the infamous “three no’s” that once guided Arab foreign policy: No peace with Israel, no negotiations with Israel and no recognition of Israel.

To be sure, while Saudi Arabia and Gulf Arab rulers publicly reject peace with Israel until the Palestinian issue is resolved, changing Middle Eastern dynamics have created new priorities for Gulf Arab rulers and opened up new opportunities for regional alliances.

During the 1950s and ‘60s, Gamal Abdel Nasser guided Arab opinion and policy. In the decades that followed, other Arab leaders attempted — but ultimately failed — to replicate Nasser’s success, including Hafez al-Assad, Moammar Gaddafi and Saddam Hussein. These leaders lacked Nasser’s charisma and popular legitimacy, and their brutality and intervention in other Arab countries obstructed Arab unity.

If there was one issue that publicly unified the Arab world during this period, it was support for the Palestinians and hatred toward Israel. And yet, Arab rulers freely cast the Palestinians aside when it suited their needs. In 1970, King Hussein expelled the Palestine Liberation Organization from Jordan after it attempted to overthrow his kingdom. Lebanon expelled the PLO during the Lebanese Civil War in 1982. And in the 1990s, Kuwait and Libya expelled thousands of Palestinians.

During the rule of the Shah between 1953 and 1979, Iran was not a major competitor for Islamic influence or regional leadership on the Palestinian issue. The Shah was much more concerned with building a massive military and intelligence service to suppress any dissent within his country. He was also a reliable ally of the West. As such, in 1950 Iran recognized Israel and supplied it with oil and intelligence.

Today, however, regional power dynamics have shifted in ways that have reshaped priorities with regard to the Palestinian-Israeli conflict. With the partial exception of Saudi Arabia, the Arab world is in tatters: Syria and Iraq are failing states; Yemen faces a humanitarian disaster; Egypt struggles to contain an Islamist insurgency; Libya is plagued with terrorism, rival governments and reports of modern-day slavery; and Lebanon had recently been without a president for over two years and remains unstable.

Iran, by contrast, has proven more resilient and ambitious than its Arab neighbors. Since the Shah was overthrown in 1979, Iran has sought to export its Islamic revolution, extend its influence in neighboring nations and support Shiite communities and the “oppressed” outside its borders.

Over time, Iran has successfully cultivated political alliances with both Shiite and Sunni communities and leaders who sympathize with their worldview in Iraq, Syria, Lebanon, the Gaza Strip and Yemen.

Iran’s greatest prize is Hezbollah in Lebanon. Created, financed and trained by Iran in the early 1980s, Hezbollah is a Shiite Islamist militant and political movement. Hezbollah served as a strategic asset for Iran to have a presence in the eastern Mediterranean, enhancing its ability to exert regional influence.

Hezbollah initially aimed to expel American and Israeli forces from Lebanon during the Lebanese Civil War — which occurred in 1984 and 2000, respectively. Yet Hezbollah did not surrender its weapons after these withdrawals. Instead it has remained a major regional power, most recently, deploying to Syria to help achieve Iran’s goal of sustaining President Bashar al-Assad’s regime and destroying the rebels and the Islamic State.

Iran’s meddling, partially through Hezbollah, has left Gulf Arab rulers — and to a lesser extent the leaders of Egypt and Jordan — anxious over what they view as Iranian interference in their domestic affairs. Two recent pivotal events helped weaken the Arabs and strengthen Iran: the 2003 U.S.-led war in Iraq and the uprisings that began in Tunisia in December 2010 and spread across North Africa and the Middle East.

In 2004, Jordan’s King Abdullah cautioned that toppling Saddam Hussain’s Baath Party would grant Iran unprecedented influence in Shiite-majority Iraq. He fretted about the formation of a “Shiite Crescent” in which Persian-Shiite influence extended from Tehran to Shiite communities and militias in Iraq, the Assad regime in Syria and Hezbollah in Lebanon. Since the Arab Spring protests in 2010 and the 2015 coup in Yemen, this Shiite crescent has expanded further, as Iran exerts even greater regional influence through the Houthis, a Zaydi sect of Shiite Islam.

Statements by Iranian officials boasting that through their proxies Iran controls four Arab capitals does little to alleviate Gulf Arab anxiety.

Moreover, the 2015 deal between Iran and the West, which aimed to hinder Tehran’s nuclear capability, permitted the Islamic Republic to access more than $100 billion in frozen assets. Although much of that money will go toward Iran’s depressed economy, it will also fund Iranian interests abroad.

Given these dire conditions, the Cold War era when the Palestinian question was of paramount importance is over. The Arabs are totally preoccupied with Iran, and in their anxiety and weakness, they have turned to Israel for help.

The Shifting Alliances in the Middle East

Once their sworn enemy, Gulf Arabs now perceive Israel as a powerful ally against Iran and have held clandestine talks regarding mutual security concerns. Expressing admiration for Israel — once considered taboo until the Palestinian issue was resolved — is now common in the Arabic media.

In a 2015 interview with the Israeli i24 TV channel, a high ranking Saudi general named Anwar Eshki declared that Israel is a reality that the Arabs must accept, and proclaimed in Hebrew, “I am ready to defend peace with all my heart.”

In a November article in the Saudi Arab News, Khalaf Ahmad Al-Habtoor, a prominent Emirati businessman and writer, was even more blunt, explaining that the Arabs and Israel have mutual interest in resolving their differences and establishing peace so that they can unite against their common enemies — Iran and its allies.

This sentiment has led to Gulf state Arabs adopting a tougher line toward the Palestinians. In an interview with the Arabic An-Nahar TV channel, the Saudi ambassador in Algeria, Sami bin Abdullah al-Saleh, denounced Hamas as “a terrorist organization that rules from 5-star hotels in Qatar.”

An alliance seems to be budding — the Agence France-Presse news agency reported that Saudi Crown Prince Mohammad bin Sultan made a secret visit to Tel Aviv in September, although Saudi Arabia denied the report.

This outreach toward Israel is not lost on the Palestinians, causing a sense of panic and isolation. Some Palestinians claim that Saudi Arabia is an agent of Israel and the United States, and seeks to liquidate the Palestinian cause to concentrate on Iran.

This mutual frustration has spilled over on Twitter, with Saudis creating anti-Palestinian hashtags and ridiculing them as traitors for abusing decades of Saudi financial and political support.

This emerging Israel-Gulf Arab alliance stems from self-interest, not from altruism or shared values. However, the relationship is not one-sided.

For Israelis, ties with Saudi Arabia and the Gulf Arabs provide the acceptance as a legitimate state they have craved since 1948. It also provides Israel with a multilateral diplomatic option, in which the Gulf countries could pressure Palestinian President Mahmoud Abbas to bypass stalled bilateral negotiations with the Palestinians — and potentially achieve more of what it wants in peace negotiations.

For the Gulf Arabs, Israel is the closest military power to help defend against Iran’s might. The Arabs hope that Israel will strike Tehran or at the very least provide their states with air cover against a possible conventional war. Without Israeli support, the Gulf Arabs could not withstand a direct Iranian assault.

Israel’s close relationship with Washington can also be leveraged to secure greater assurances of Western protection from Iran. Thus, the Gulf Arabs see Israel as a valuable ally to sustain their own rule and protect their interests.

Iran, which vies with Saudi Arabia for leadership in the Muslim world, claims Gulf Arab-Israel ties sow strife among Muslims by producing enmity between Arabs and Persians and Sunnis and Shiites.

But as long as Iran continues to interfere in one-fifth of the Arab world and calls for Israel’s destruction, the Israel-Gulf Arab alliance probably will endure. Yet it will also probably remain below the radar, because strategic cooperation against Iran, not comprehensive peace that solves the Israeli-Palestinian conflict, is the overarching priority for both parties.