This February marks the 40th anniversary of the 1979 Iranian Revolution, when Ayatollah Ruhollah Khomeini returned to Iran after 15 years in exile to seize the reins of power from the last shah of Iran, Mohammad Reza Pahlavi, who had fled the country the previous month.



Among the many things that fundamentally changed that year for Iran was a hitherto warm decade-old relationship with Egypt.



It is, therefore, an apt point of time to look back on Tehran's modern relationship with Cairo.

A fitting moment to start would be 1939, when Pahlavi, then the young crown prince of Iran, was married to Princess Fawzia Farouk of Egypt, the sister of King Farouk. This was a clear bid by Pahlavi's father, Reza Shah, to link Iran's royal family with Egypt's, then a far wealthier family.



"Only two weeks before the wedding the royal bride and groom had never met," pointed out the announcer for the Gaumont British News at the time, before quipping: "It seems a strange eastern custom. But not so strange as sometimes happens in the west, when only two weeks after the wedding, bride and groom wish they'd never met."



Ultimately, the marriage never amounted to much. Neither loved the other and Fawzia missed Egypt badly - and finally returned there in 1945. While the two had one child, a daughter, the pair were officially divorced in 1948.



Egypt and Iran had also both been caught up in the Second World War.



Iran was invaded by Britain and the Soviet Union in 1941; Reza Shah left the country and the 21-year-old Crown Prince Mohammad Reza Pahlavi became shah.



For his first decade in power, the young shah was in a very weak position.



"Until '53, my life was a succession of pain and suffering and humiliation," he once recalled.



Iran was a major logistical hub for Allied support for the Soviet Union against Nazi Germany throughout the war. Iran's famous Veresk Bridge became known as "Pol-e Piroozi", "the bridge of victory".



Egypt was, of course, the site of the war's two decisive battles in El Alamein, between Britain and Axis powers Germany and Italy, a mere 150 miles from Cairo.



The Farouk monarchy was overthrown by the Free Officers Movement in 1952 and one of its members, the charismatic Gamal Abdel Nasser, became Egypt's president shortly thereafter. Relations with Iran would suffer as the two regimes later became major rivals in the region.



During the 1950s, Britain, whose empire had just collapsed, sought to retain control over two valuable imperial possessions in both Iran and Egypt. In Iran, the Anglo-Persian Oil Company, Britain's "single largest overseas asset", and in Egypt, the Suez Canal. Both were nationalised in the 1950s, resulting in retaliation by infuriated British governments.



In Iran, the nationalist Prime Minister Mohammad Mossadegh famously nationalised Iran's oil reserves in 1951, an action so significant that Time Magazine chose him as its "Man of the Year".



Two years later, amid political tumult in Iran that resulted in Pahlavi briefly fleeing the country, Mossadegh was overthrown, largely as a result of an Anglo-American coup against him. Consequently, the shah was able to return to the country and claim victory.

In Egypt, Nasser's nationalisation of the Suez Canal resulted in direct British military action against Egypt. As part of a plot hatched with both France and Israel, Britain attacked Egypt in a bid to retake control of the canal and topple Nasser. The effort ended in an abysmal failure when the Americans pressured the three powers to retreat, which they subsequently did.



British Prime Minister Anthony Eden, who masterminded the effort, resigned shortly thereafter.



At arguably the height of his power and influence, Mossadegh sought an alliance between Iran and Egypt against Britain. On November 22, 1951, during a joint press conference with Egypt's Prime Minister Mustafa El Nahas Pasha, the Iranian prime minister wept while telling journalists that "a united Iran and Egypt will together demolish British imperialism" and that by uniting they would "close the doors to all foreign imperialism".



He declared that he sought to expand a treaty of friendship and commerce adopted between Cairo and Tehran in 1928 and use it as the basis of "multilateral agreements on a wider scope so as to include Arab, Near and Middle Eastern countries which were linked to Egypt and Persia by friendly ties".



None of this came to be. After Mossadegh's 1953 ousting the former Iranian prime minister lived under house arrest until his death in 1967.

In July 1960 Nasser directly denounced the shah for 'selling himself cheaply to imperialism and Zionism'

Nasser's Egypt

Under Nasser, Egypt never had good ties with the shah's Iran. In 1950, Iran gave de-facto recognition to the State of Israel, something that deeply irked Nasser, who promulgated Pan-Arabism and staunch opposition to Israel. Consequently, Nasser often depicted the shah as a lackey of the Americans and Israelis.



The shah, for his part, deeply feared Nasser and his influence in the Middle East. He began secret dealings with Israel in 1958 to establish a covert broadcasting station in the Iranian city of Ahwaz, capital of the country's Khuzestan province, that broadcasted anti-Nasser propaganda across the Middle East.



The shah also suspected Nasser had some hand in the overthrow of the Iraqi monarchy that same year, an event that deeply worried him, given how members of the Iraqi monarchy were brutally murdered. He also feared that Nasser supported Arab separatists in Khuzestan. In the late 1940s, the shah had to deal with Soviet-backed Azeri and Kurdish separatist movements that successfully broke away from the rest of the country for a brief period.



It's likely he feared Nasser doing the same in Khuzestan.



In July 1960, Nasser directly denounced the shah for "selling himself cheaply to imperialism and Zionism".



Arras Aram, Iran's minister for foreign affairs at the time, responded by calling Nasser a "feeble-minded pharaoh of Egypt" and declaring that Iran would not recognise his "illegal regime".



Nasser broke ties with Iran in 1960, ostensibly over its recognition of Israel a decade earlier. In reality, Tehran had given de-facto acknowledgement of the existence of the Israeli government. At a 1960 press conference, the shah stressed to the Arab states that this stance remained the same and that he was not moving to fully recognise Israel.



Nasser's Egypt was also believed to have been behind a series of broadcasts across the Middle East denouncing the shah. Those broadcasts urged Iranians, among other things, to "kill the pig of a shah and throw his body into a river" and appealws to the Iranian army to "raise up and rend the oppressor of the people into a million pieces".



In December 1964, Nasser once again hurled insults at the shah, again calling him "a stooge for America and Zionism" and claiming that both had told the Iranian autocrat to insult Egypt - under the belief that "what he says will be accepted as coming from a Muslim country".



"Though Iran is a Muslim country, we do not consider the shah as a Muslim as he is subjected to Zionist influence," Nasser said at the time, echoing the kind of rhetoric used by Ayatollah Khomeini.



Nasser's Egypt militarily intervened in the Yemeni Civil War that raged throughout the 1960s - a campaign that has since been dubbed "Egypt's Vietnam" in light of the fact it cost the lives of more than 10,000 Egyptian troops over five years and cost the country billions of dollars.



The presence of Egyptian armed forces on the southern shores of the Gulf made regional powers, including Imperial Iran, nervous. The shah directly accused Nasser of waging "aggression" against Yemen and said the presence of Egyptian troops in the region constituted "an act of aggression".



"Why else would Egypt keep 50,000 troops there?" he asked rhetorically at the time, stressing that Tehran did not recognise the Egypt-backed Republican regime in Yemen "because it does not represent the will of the Yemeni people".



Despite his denunciations, the shah said at the same time that he welcomed improved relations with Egypt - provided that Nasser overcame "his difficulties with us in the realisation of our programme and his programme..."



In 1966, the shah believed the threat posed by Communism and the Soviet Union had declined considerably "but the danger of aggression from some of our Arab neighbours remains and cannot be ignored".



It was clear he was referring to neighbouring Iraq, but also Nasser's Egypt further afield.



That same year, his longest-serving prime minister, Amir Abbas Hoveyda, also expressed Tehran's opposition to Egyptian forces in the wider Gulf region. Upon referring to Egypt, Hoveyda said: "We feel the Persian Gulf belongs to the states of the Persian Gulf. There is no room for outsiders."



In June 1967, Egypt suffered a devastating military defeat at the hand of the Israelis, with 80 percent of its air force wiped out on the very first day of the war in a devastating surprise attack. Despite suffering that military defeat, Tehran was still wary of Egyptian military strength by late 1967.



The shah and Hoveyda still expressed fears at that time that Cairo could take over the oil-rich Gulf region. "We cannot risk what we have accomplished in this country," Hoveyda said after being asked if the Egyptian defeat the previous summer had changed Tehran's calculations. He then went on to list some of the military hardware Iran had on order.



In June 1969, the shah said Iran had lifted a major condition it had for the resumption of diplomatic ties with Cairo, namely an "official apology".

Following Nasser's death, the shah and Nasser's successor, Anwar Sadat, forged a close friendship

Cataclysm



By August 1970, Iran and Egypt decided to resume full relations. Following Nasser's death, the shah and Nasser's successor, Anwar Sadat, forged a close friendship.

After the 1973 Arab-Israeli War, which began when Egypt and Syria jointly attacked Israel in a failed attempt to reclaim the Sinai Peninsula and Golan Heights they had lost in 1967, the shah supported Sadat in his diplomatic efforts to forge a peace agreement with Israel that would include the complete return of the Sinai to Cairo.



In 1975, the shah even suggested to the Ford White House that were a crisis to emerge in Saudi Arabia, such as the rise of a figure like Libya's Muammar Gaddafi, Iran and Egypt could invade the kingdom and seize its oil reserves.

The inclusion of Egyptian troops alongside Iranian ones, Pahlavi argued, would prove necessary to ensure the invasion force would not be entirely non-Arab. The fact that the Iranian leader supported a potential Egyptian military presence in Saudi Arabia showed just how much relations had improved between the two major powers following Nasser's death.

In January 1975, Egypt and Iran issued a joint communique calling upon Israel to withdraw from the Sinai. The following month, the shah, directly addressing an Israeli argument for retaining its hold over Sinai at that time, even offered to replace any oil Israel lost as a result of returning the Abu Rudeis oil fields in Sinai to Cairo.

By the time of the Iranian Revolution and the shah's infamous departure from the country in January 1979, after which he travelled the world to various countries seeking refuge, Sadat was the only Arab leader to lend support to his old friend. On top of that, the Egyptian president also denounced Khomeini as a "lunatic".

Khomeini, in turn, called upon the Egyptians to overthrow Sadat - just as the Iranians had overthrown the shah. Khomeini staunchly opposed the Camp David peace accord between Egypt and Israel and consequently severed relations with Cairo.



Just as Nasser once denounced the shah as an American stooge and ally of Israel, the new regime in Iran did the same against Sadat.



The shah died of cancer on July 27, 1980, and was buried in Cairo, where his tomb remains to the present day. The following year, President Sadat was ruthlessly assassinated by four gunmen led by the Islamist militant Khalid Isalbouli. Tehran rejoiced and even named a street after Isalbouli.



Shortly after Sadat was gunned down, Ayatollah Hussein-Ali Montazeri, the second most powerful Ayatollah in Iran at that time, called upon Egyptians to take advantage of the assassination and rise up against the government.



"Don't let the American regime [in Egypt] recover," Montazeri urged Egyptians. "Muslim nation of Egypt, your Islamic movement has entered a new stage with the destruction of the Pharaoh of Egypt and an important element of the shameful first Camp David treaty of enslavement."



Hosni Mubarak succeeded Sadat. Under his lengthy autocratic tenure as president, Egypt and Iran never restored ties. Throughout the eight-year Iran-Iraq War of the 1980s, Mubarak never spoke in favour of Iran's actions.



By the summer of 1982, the Iranians had ejected all invading Iraqi forces from Khuzestan and launched a counteroffensive of their own into Iraq that lasted until the war's end six years later. Egypt opposed Iran's counteroffensive. Cairo also provided the Iraqis with anti-personnel artillery rounds for use against the infamous Iranian human-wave infantry attacks against their positions.



Egypt was an extremely important peripheral country for the Arab states fearful of an Iranian victory over Iraq. As one Associated Press analysis noted in 1982, since Syria was essentially on the Iranian side of that war, "the only other Arab force capable of checking an Iranian advance into Iraq is Egypt's 367,000-member army".



In October 1983, Mubarak even warned Tehran that Egypt would take military action against Iran if it lived up to its threat to either close the Strait of Hormuz into the Gulf or attack Arab ports there.



Throughout the conflict, Egyptians argued it should intervene if Iraq were at risk of losing. Egyptians generally sympathised far more with the Iraqis. In the 1980s approximately one-million Egyptian guest workers also lived in Iraq.



"Security in this region is part of the security of Egypt," Mubarak declared in January 1988. "Egypt under no circumstances will relinquish the obligation to safeguard the security of its sister Arab powers."



In May 1987, Egypt severed its remaining ties with Iran by closing its tiny two-member interest section in Cairo and recalling its sole diplomat from Tehran. Cairo made this move after accusing Tehran of giving financial backing to 37 Islamists the Egyptian security forces had just arrested.



Even late in the war, when a US missile destroyer shot down the Iran Air Flight 655 Airbus over the Gulf, killing all 290 civilians aboard, Mubarak still blamed Iran. While describing the incident as "a very big disaster", he went on to state: "At the same time, I blame Iran because of the existence of the state of war and because of its refusal to accept peace efforts."



Iran did agree to a ceasefire with Iraq in August 1988, which formally ended the eight-year conflict which left more than a million dead in its wake.



In July 1990, one month after a deadly earthquake killed 40,000 people in northwest Iran, Egypt sent relief supplies. This led to a brief thaw between the two nations and even some talk of restoring ties. This did not, however, materialise.

In 1993, both Egypt and Iran tried to win favour from Saudi Arabia in their rivalry

Approaching a new century



In December 1992, Egypt was once again condemning Iran. This time it alleged that Iran's Islamic Revolutionary Guard Corps (IRGC) paramilitary were training Islamist fighters opposed to the Mubarak regime in neighbouring Sudan. Mere days after this accusation Tehran withdrew its sole diplomat in Cairo.

In 1993, both Egypt and Iran tried to win favour from Saudi Arabia in their rivalry. Mubarak wanted the Saudis and their allies to help his country in preventing Iran from supporting various Islamist groups opposed to his regime. The Iranians, on the other hand, wanted the Saudis to oppose Egyptian participation in the Gulf region's security in the aftermath of the 1991 Gulf War against Saddam Hussein's Iraq.



Riyadh opted to remain relatively neutral in their rivalry at that time, with one Saudi official stressing: "We have to balance, we have to hear both sides of the stories."



In June 2000, Iran and Egypt had their first soccer match, in which the latter narrowly won. The game was hailed as a diplomatic victory between the two countries. The same month, Iran's then-president Mohammad Khatami spoke with Mubarak by phone, the first time leaders from the two countries had spoken directly since the revolution.



Then, in December 2003, the two presidents met on the sidelines of a conference in Geneva and the following month Khalid Isalbouli Street in Tehran was renamed Intifada Street, a likely clear reference to the Palestinian Intifada against Israel. These two developments were again small, but not insignificant, signs of a thaw in Egypt-Iran relations.



Then, in December 2005, Iran extradited Mustafa Hamza, an Islamist who was believed to have taken part in Sadat's assassination and an attempted assassination of Mubarak in 1995. This too was another sign at the time as another step towards restoring relations.



In May 2007, Egypt's Foreign Minister Ahmed Aboul Gheit held a gala dinner in the Egyptian city of Sharm el-Sheik, where he hoped his Iranian counterpart Manouchehr Mottaki could have an informal conversation with then US Secretary of State Condoleezza Rice on the sidelines of the international conference on Iraq there. Mottaki, however, abruptly skipped the dinner altogether because he did not consider the low-cut red dress of the Ukranian female violinist performing appropriate or modest.



Relations with Tehran took a turn for the worse in April 2009. That month Cairo said it had broken up a Hizballah cell planning attacks in the country. Hizballah leader Hassan Nasrallah denied this, saying Hizballah was trying to send military equipment into the Gaza Strip, which had just then come out of the major December 2008-January 2009 22-day war between Hamas and Israel.



Mubarak made a thinly veiled warning to Hizballah, which more likely than not also applied to its patron, Iran.



"We are aware of your plans… We will expose your plot and catch you,£ he said. "Stop [exploiting] the Palestinian issue and be warned of Egypt's fury."



Revolution, this time in Egypt



The January 2011 Egyptian Revolution, which resulted in the end of Mubarak's lengthy presidency, led to a notable improvement in relations.



The following February an Iranian warship passed through the Suez Canal for the first time since the 1970s.



Following the election of the Muslim Brotherhood's Mohammed Morsi as Egyptian president, the country's first ever democratically elected president, in June 2012, ties improved substantially for a brief period.



Morsi visited Tehran in August 2012, becoming the first Egyptian leader to visit Iran since the end of the shah's reign. While he declared his opposition to Iran's ally President Bashar al-Assad for brutally crushing the uprising against his rule, the visit was nevertheless a success. He and then Iranian President Mahmoud Ahmadinejad even agreed to reopen embassies in each other's capitals.



Ahmadinejad reciprocated by visiting Cairo in February 2013. The next month, direct flights were established between Tehran and Cairo, another first since the Iranian Revolution.



An Iranian tour group of about 50 visited Egypt that March. Salafist Egyptians expressed their fears that the Iranians would exploit the relaxed travel restrictions in order to promulgate Shia theology in the country. The tour group was the only notable one to visit the country before Egypt was once against convulsed by another upheaval.



In July 2013 Morsi was overthrown by the military in a coup. Army chief Abdel Fattah el-Sisi then oversaw a bloody and ferocious crackdown on the Muslim Brotherhood and a wide range of other dissidents of different stripes in the country. He became president the following year.



Fawzia, incidentally, died the same month as the coup, aged 91.



Relations between Cairo and Tehran, while not antagonistic, haven't improved since the coup. Sisi's Egypt is closely aligned with Saudi Arabia and the United Arab Emirates, Iran's primary rivals in the Gulf region. Riyadh and Abu Dhabi oppose the Muslim Brotherhood and have accordingly propped up Sisi with billions of dollars in order to see the group suppressed.



Given Sisi's regional alignment, any real normalisation of relations between Cairo and Tehran is highly unlikely, at best, for the foreseeable future.



Interestingly, Sisi echoed 1980s Mubarak when, in a clear bid to reaffirm Egypt's commitment to the security of its Gulf allies, he declared last November: "We stand by our brothers in the Gulf wholeheartedly and if Gulf security is directly threatened by anyone, the Egyptian people, even before their leadership, will not accept that and will mobilise forces to protect their brethren."



It was clear Sisi was referring to Iran.



The 40th anniversary of the Iranian Revolution this month is a striking reminder of how Egypt and Iran - which, along with Turkey, are the major peripheral countries of the Middle East - still haven't recovered from the low point of the revolution years to anywhere even closely resembling the high point of the Shah-Sadat years.



Egypt is notably the only Arab country that has not had an embassy in Tehran since 1979.



Both these countries are very important and can heavily influence the future of the entire region: Egypt because it is the most populous Sunni Arab country and home of the Al-Azhar University, the oldest university in the world and the centre for the teaching of Sunni Islamic theology, and Iran because it is the world's largest Shia Muslim country.



The future of relations between these two major countries is uncertain at best. In the absence of another upheaval in the region, a possibility that can never be dismissed out of hand in the Middle East, these two powers are likely to retain the current status quo of being neither friends nor enemies well into the foreseeable future.



