In the wake of the past two decades of acrimony between Iran and Israel, it may be hard to imagine that the countries ever had friendly relations and cooperation on multiple levels. Yet they were once friends and allies. And even after the Islamic Revolution of 1979, when Iran abruptly severed diplomatic ties with Israel, military cooperation continued for several years as Iran turned to Israel to arm it during its devastating war with neighboring Iraq.

Even today, as the tension between the two countries continues to mount and the danger of a direct confrontation appears genuine, one can reasonably say the two countries were never meant to be enemies. They share no common borders and have no territorial disputes. Moreover, Jews have lived in Persia (as Iran has been known through history) for some 2,700 years, and their tradition remembers it as a place of refuge – in particular under the reign of the emperor Cyrus the Great in the sixth century B.C.E.

>> Israel braces for Iranian retaliation for Syria strike – but war isn’t inevitable ■ Netanyahu tries but fails to bury Iran nuclear deal before Trump actually kills it ■ Great show, glaring flaw: 3 takeaways from Netanyahu’s ‘Iran lied’ speech

Following Israel’s independence in 1948, when Iraq cracked down on its Jewish citizens and many fled the country to resettle in Israel, Iran served as a way station for large numbers of them after their escape. Iranian officials were paid generously for that service, of course.

Officially, Iran voted against the UN Partition Plan for Palestine in 1947, and, after the establishment of Israel, opposed its acceptance as a member state into the organization. Nonetheless, in 1950 Iran became the second Muslim-majority country (after Turkey) to give Israel de facto recognition, which became open and official a decade later.

Open gallery view Senior Iranian defense officials with Israeli counterparts at the IDF headquarters, 1975 Credit: Public domain / Wikimedia Commons

Each country had its own reasons to want relations with the other. For Iran, Israel was perceived as a vehicle (via the American-Jewish community) for gaining the sponsorship of the United States, which was seeking allies in its struggle for both regional and global dominance with the Soviet Union.

Today, Iran’s rivalry with the Arab world is in large part framed in religious terms – the Shi’ite minority (led by Iran) versus the Sunni majority (dominated by Saudi Arabia). But in the 1950s and ’60s, Iran saw itself threatened by the spread of Soviet-sponsored pan-Arab nationalism, whose mascot was Gamal Abdel Nasser, leader of Egypt’s revolution in 1952.

As long as the Cold War continued, Iran, as a major source of oil and with its control of access to the Persian Gulf, was an important U.S. ally. In this regard, it found common cause with Israel.

Within Iran, Muslim and secular forces were at odds, with one of the issues being the demand of religious leaders like Ayatollah Ruhollah Khomeini that Iran join the Arab axis in fighting Israel. But it was the latter camp that had the upper hand during the rule of the shah, Mohammad Reza Pahlavi, who consolidated his power after a 1953, U.S.-led coup restored him to power.

Open gallery view The deposed Shah of Iran vacationing with his wife and children in the Bahamas, March 1979. Credit: ASSOCIATED PRESS

From Israel’s point of view, Iran fit into the “Periphery Doctrine” of Israel’s founding prime minister, David Ben-Gurion – by which Israel tried to cultivate relations with the non-Arab enemies of its enemies. (These countries included Iran, Turkey and Ethiopia, as well as the Maronite Christians in Lebanon and the Kurds in Iraq.)

Relations were far-ranging, but to a large extent given a low profile. Iran sold Israel oil when none of the other oil-rich states in the region would do so. It also became a major importer of Israeli goods and services. These included not only agricultural, residential, medical and infrastructure projects, but also the training Israel’s intelligence agencies provided to the shah’s notoriously cruel secret police, Savak.

Hard as it may be to imagine now – as Prime Minister Benjamin Netanyahu leads a full-court press to convince the United States to withdraw from the 2015 nuclear accord with Iran – but a mere two years before the Islamic Revolution, Israel and Iran cooperated on “Project Flower,” a joint plan to develop a missile that could carry a nuclear warhead.

During the ’60s and ’70s, Israel had so many contractors and military advisers resident in Tehran, a Hebrew-language school was opened there for Israeli children. And El Al operated regular flights between Tel Aviv and the Iranian capital.

Beginning of the end

Open gallery view Iranian President Mahmoud Ahmadinejad delivering a speech on the 18th anniversary of the death of the late revolutionary founder Ayatollah Khomeini, in Tehran, June 2007. Credit: AP

Just as the relationship flowered in response to larger political conditions, it also came to an end because of larger geopolitical changes. The death of Nasser in 1970 and the ascension of Anwar Sadat led to a warming of relations between Egypt and Iran. Furthermore, the signing of an accord between Iran and Iraq in 1975 – in which Iran agreed to stop arming Kurdish-Iraqi separatists – led to a temporary lessening of hostility between those implacable enemies. In both cases, Israel’s strategic value to Iran suffered.

All the while, Islamic clerics in Iran kept up a stream of negative indoctrination against Israel. For example, in an article for Iranica Online, the Israeli scholar Prof. David Menashri quotes Khomeini in 1971 as describing Israel as having “penetrated all the economic, military, and political affairs” of his country, and turning it into “a military base for Israel.”

When the shah was overthrown in a popular uprising in 1979, and his authoritarian secular regime was replaced by a no-less-oppressive Islamic one, the relationship with Israel was one of the first things to go.

Ayatollah Khomeini returned from exile in France on February 1, 1979, and less than three weeks later – on February 18 – he severed relations with Israel. Adding insult to injury, Khomeini turned the evacuated Israeli Embassy over to the Palestine Liberation Organization.

Open gallery view A visitor looking at portraits of Iranian President Mahmoud Ahmadinejad and Israeli Prime Minister Benjamin Netanyahu during the exhibition "Faces of Power" in Cologne, 2012. Credit: ASSOCIATED PRESS

Nonetheless, the connection continued until the mid-’80s – mainly because Khomeini’s Iran quickly became embroiled in open conflict with Saddam Hussein’s Iraq. For Israel, reluctant to acknowledge that Iran no longer loved it, the opportunity to arm the Islamic state against Iraq was irresistible. Between 1981 and 1983, it sold an estimated $500 million-worth of arms to Iran, most of them paid for in oil.

The notorious “Iran-Contra” deal of the mid-1980s, as another example, was a bizarre plot by which Israel was to sell its own out-of-date American weapons to Iran and transfer the money it received, minus a commission, to the counterrevolutionaries battling the socialist regime in Nicaragua – despite a congressional ban on U.S. aid to the Contras.

With the fall of the Soviet Union and the defeat of Saddam Hussein’s regime in the 1991 Gulf War, the main threat to Iran became the United States – the “Great Satan” – whose regional handmaiden was the “Little Satan” (Israel).

If the New Middle East that was to come into existence following the Gulf War was expected to lead to reconciliation between Israel and the Arab world, Khomeini’s Iran was happy to pick up the banner of resistance to the “Zionist regime.” This led to the creation of local proxies on Israel’s border, employing radical-Islamist ideology in the pursuit of an uncompromising, zero-sum battle with the Jewish state.

During the ’90s, the rhetoric between Tehran and Jerusalem become increasingly hostile and threatening, as Iran took the place of Iraq as the most significant strategic threat to Israel. Hamas in Gaza, Hezbollah in Lebanon and Iranian-backed terror cells in, for example, Buenos Aires, all carried out the Islamic regime’s battle against Israel and Jews worldwide, to devastating effect.

Although it was under Netanyahu that the presumed Iranian plan to develop nuclear weapons emerged as a prime military concern, it was predecessors Yitzhak Rabin and Shimon Peres who really began to drum into the Israeli public, and also internationally, the danger that Iran supposedly constituted – not just to Israel, but also to the new international order that was to follow the fall of the USSR.

Whereas Rabin had in 1987 called Iran “Israel’s best friend,” a few years later he was referring to the country’s “dark, murderous regime.” In 1996, meanwhile, Peres called the Islamic regime “more dangerous than Hitler.”

Open gallery view Iranian schoolboys shooting toy guns at an Israeli flag as it burns during an anti-Israeli rally marking "Al-Quds Day" (Jerusalem Day), Tehran, Oct 2005. Credit: AP

Iran’s leaders were no less complimentary about Israel. The rhetoric reached its height under two-term president Mahmoud Ahmadinejad (2005-2013), who talked about the “stinking corpse of the usurping and fake Israeli regime,” called for Israel’s “annihilation” and denied the Holocaust. But every regime since the Islamic Revolution has marked Al-Quds Day to give expression to Iranians’ opposition to Israel’s existence and the situation of the Palestinians.

The mutual hostility, however, extends far beyond rhetoric. It’s a well-known secret that, before the nuclear accord was signed in 2015, Netanyahu was pushing for the United States – or for Israel itself – to attack sites in Iran associated with its nuclear plans. Israel also is suspected of having carried out a wide range of covert actions during those years intended to slow down the program’s progress.

Open gallery view Ayatollah Ruhollah Khomeini leaving the plane that flew him back from exile in France to Tehran, February 1, 1979. Three weeks later, he severed relations with Israel. Credit: AFP

Today, as the deadline for U.S. President Donald Trump’s decision on whether to withdraw from the Joint Comprehensive Plan of Action approaches, Netanyahu is pulling out all the stops to convince the United States to do just that. At the same time, Iran’s presence in Syria, its arms-development facilities there and its ongoing attempts to transfer sophisticated weapons to Hezbollah continue to elicit increasingly harsh responses that foreign media attribute to Israel (with some even acknowledged by Israel). Iran may hold off on hitting back at Israel until after Trump announces his intentions, but few doubt it will refrain from responding altogether.