The last shah of Iran, Mohammad Reza Pahlavi, was overthrown in that 1979 revolution and fled to Egypt , where he was granted asylum by then-President Anwar Sadat. Diplomatic ties between the two countries were severed in 1980. They resumed 11 years later under Hosni Mubarak, but only at the chargé d’affaires level, with interest offices instead of embassies in both countries.

Several question marks hover around the countries' future relations. Egypt regularly shares Iran's celebration of the revolution, so that's not extraordinary — unless one considers that this very occasion brings to mind the beginning of the deterioration of modern relations between the two countries.

In a speech, Nasser al-Kanaani, head of Iran's Interest Office, its de facto embassy in Cairo, said Tehran looks forward to seeing security and stability in Egypt. He said he believes the two countries will develop their relations — sooner or later — and he underlined Tehran’s readiness to follow this path should the Egyptian government have the political will to do the same.

The countries' representatives exchanged pleasantries Feb. 12 when an Egyptian diplomatic delegation headed by Assistant Foreign Minister for Asian Affairs Khaled Sarwat attended a ceremony at the Iranian ambassador’s residence in Cairo to celebrate the 40th anniversary of the Islamic Revolution.

CAIRO — Relations between Egypt and Iran have fluctuated greatly over the years — over the millennia, actually — and remain mutable today.

Hassan Abu Talib, adviser to the Al-Ahram Center for Political and Strategic Studies, told Al-Monitor that Kanaani's sanguine speech wasn't surprising. “It's in Iran’s best interest to have normal relations with Egypt,” Abu Talib said, adding that Egypt's not against improving relations with Iran, with certain conditions.

Over past decades, Egyptian-Iranian relations have strained at different levels. Under President Gamal Abdel Nasser, relations were marked by disagreements and hostility, especially after the 1955 Baghdad Pact, a Cold War alliance that included Tehran and that Egypt deemed unreliable.

Under Sadat, relations took a new political turn following the Yom Kippur War of 1973, which resulted in the 1978 Camp David Accords and a rapprochement between Egypt and the United States, which led to good relations with the shah of Iran.

Relations soured again when Egypt signed a peace treaty with Israel in 1979. Tehran rejected the pact.

Ties between Iran and Egypt also frayed as a result of Cairo's support of Iraq during the 1980-88 Iran-Iraq war.

Although Egypt supported Iran’s membership in the Group of 15 in 1999, things took another bad turn in 2004, when Egypt accused the Islamic Revolutionary Guard Corps of espionage in a plan to assassinate an undisclosed Egyptian figure.

In another swing, relations improved during the rule of President Mohammed Morsi, which saw mutual visits at the presidential level.

Today, under President Abdel Fattah al-Sisi, relations with Iran are believed to be dependent on the Gulf states, which were at the front line in supporting Cairo following the June 30 Revolution of 2013. Prominent among those was Saudi Arabia. Saudis and Iranians are at opposite poles at all levels, with mutual threats of military confrontations.

During a meeting with foreign media at the Nov. 6 World Youth Forum, Sisi took a jab at Iran by saying that Egypt would not allow any undermining of Gulf security, and that the Egyptian army would move to protect Egypt’s brothers against any danger or direct threat.

On the US sanctions on Iran, Sisi said, “Instability affects us all. Any unstable country in the region would affect us.”

Abu Talib described Egypt's participation in the Iranian celebrations as mere protocol, saying it doesn't imply any shift in diplomatic relations between the two countries.

“Any change in the status quo would happen through a meeting between the foreign ministers of the two countries or through talks about joint cooperation between senior officials, whether arranged in advance or on the sidelines of an international forum,” he told Al-Monitor.

Kanaani had previously courted the Egyptian public and government, bringing up normalized relations between the two sides. In a November article in the Egyptian newspaper Veto Gate, Kanaani called for cooperation and rapprochement between Egypt and Iran in the arts, expressing regret over “banning the screening of Iranian films at the Cairo International Festival.”

“So would it be better to wait for better political conditions and improved relations to see the participation of Iranian movies in the Cairo festival, or Egyptian films in the Fajr International Film Festival in Iran?” Kanaani asked in the article.

During his visit Feb. 3 to the Cairo International Book Fair, Kanaani said he looked forward to strengthening communication between Iranian and Egyptian publishers and to the mutual participation of Cairo and Tehran in both countries' international book fairs.

Abu Talib believes normalization with Iran depends on several factors — mainly getting Iran to stop interfering in the affairs of several Arab countries, namely Yemen and Iraq, and to initiate a good-neighbor approach with its neighbors, especially Saudi Arabia.

“We would like to see normal relations between Iran and Saudi Arabia and other Arab countries. Tehran derives its strength from improving its relations with neighboring countries. Should this not happen in accordance with the rules of international law and the UN Charter, Iran would be the biggest loser,” Abu Talib said.

“The radical tide is on the rise in Iran, which can be seen through the tight grip of the Iranian Revolutionary Guard over the country and the obsession with expanding Iranian influence in Arab and Sunni communities in particular. As a Sunni country, Egypt believes this poses a threat to the nation. Therefore, it all boils down to Iranian behavior. Iranian influence is built on relations with groups that operate outside the umbrella of their states.”

Abu Talib wondered, “Would Iran accept it if Arab countries dealt with groups in Tehran and bypassed the government? I don’t think so. Any dealings or connections that don’t go through governments are seen as interference, and this isn't acceptable.”

Commenting on growing international concern about Iran's expanding influence, Abu Talib said, “We don't wish to see any wars, or American or non-American intervention in Iran. Any war at this level would have bad regional repercussions, namely economic. Egypt would undoubtedly be affected even if it wasn't involved militarily.”

He added, "We hope Iran will change its political trend, which will certainly be welcome by Egypt and other Arab countries."