When the Arab Spring revolutions broke out in 2011, the Islamic Republic of Iran hailed them as an “Islamic awakening” and considered them as a continuation of its own revolution in 1979. The affinity that Iran saw in the Muslim Brotherhood was real.

Even today Iran recognises the Brotherhood and Tehran have much in common, particularly the notion of “Islamic democracy”.

Mustapha Zahrani, the head of the Institute for Political and International Studies which is the research centre of the Iranian Foreign Affairs Department, said: “The Muslim Brotherhood’s ideas do really matter for the founders of the Iranian Islamic Republic. We believe in the Islamic democracy and in a moderate Islam: as do organisations close to the Muslim Brotherhood in Turkey and in Egypt."

Then there is the history: Ayatollah Ali Khamenei translated into Farsi the works of Sayid Qutb, an intellectual and one of the founding thinkers of the Brotherhood, who was killed in prison in Egypt in 1966. They also share the same politics: both support Palestine and are opposed to Western powers.

During the 1980s, the Iranian Islamic Republic had been a role model for many leaders of the Brotherhood, such as Fathi Yakan in Lebanon or Rached Ghannouchi in Tunisia, founder of the Movement of Islamic Tendency, now known as Ennahda.

In June 2012, Mohamed Morsi, leader of the Freedom and Justice Party, close to the Muslim Brotherhood in Egypt, became the country's first democratically elected president of the Republic. Iran applauded.

Two months later, Morsi went to Iran, during the Non-Aligned Movement Summit. That was a real event for, since 1979, Iran had not forgiven Egypt for signing a peace treaty alone with Israel. Nevertheless, after a 33-year diplomatic freeze, an Egyptian president was invited in Tehran as a Muslim brother.

When Morsi was overthrown by the army in July 2013, Hossein Amir-Abdulahian, Iran's deputy minister of Arabs affairs, claimed that Iran had condemned the coup.

"We did assure the Egyptian authorities that we do not consider the Muslim Brotherhood like a terrorist organisation. However, we did attend the investiture ceremony of President Sisi," he said.

Amir-Abdulahian said Iran had called on the Egyptian army to exercise restraint, condemning the brutalities that occurred in Egypt against the Muslim Brotherhood. In January 2014, the Egyptian authorities, offended by the Iranian support to the Brotherhood, called in the Iranian ambassador in Egypt, Mojtaba Amani.

"This coup d’etat did more bad than good for Egypt. Indeed, there are now two forces: the Brotherhood and the partisans of Marshal Sisi. Egyptian society is split in two," said Amir-Abdulahian.

Relations aggravated by Syrian crisis

But a bigger split occurred over Syria. Tehran has not forgiven the former Egyptian president for attending in Cairo, in June 2013, an Islamic conference "for the victory of Syrian people". Morsi had announced then that Egypt would cease all diplomatic relations with Syria, and criticised the military intervention carried out by the Lebanese Hezbollah - the key Arab partner for Tehran - while supporting Syrian President Bashar al-Assad.

Patrick Haenni, a former researcher at the Centre for Economic, Judicial, and Social Study and Documentation in Cairo and an expert on Egypt, called the conference a turning point.

“Important Salafi leaders attended, like a Sunni front to support the Syrian revolution. The Brotherhood felt threatened. Some of their leaders, such as Khayrat al-Shater, were close to the Salafists, who at that time, represented 25 percent of the Egyptian voters," he said.

The Syrian crisis confused Iran and all organisations who claim some sort of affiliation with Hassan al-Banna, the founder of the Muslim Brotherhood. In February 2012, Ennahda was leading Tunisia, where an international conference of Syria’s friends was taking place. That conference was supporting the Syrian National Council, bringing together all the major opposition parties - among them the Syrian Muslim Brotherhood which represented the majority.

Around the same time, the Palestinian Hamas, which had been funded in part by Tehran, moved closer to Qatar and Turkey. In June 2013, its leader, Khaled Meshaal, attended in Qatar a conference in support of the Syrian opposition, where the Egyptian preacher Youssef al-Qaradawi, a leading contemporary theorist of the Muslim Brotherhood, harshly attacked Hezbollah - in English the Party of God - and called it the ‘Hezb al-Shaitan’ - the party of the Devil.

In February 2016, Fahmi Howeidy, an Egyptian writer and intellectual close to the Muslim Brotherhood, was invited by the Department of Foreign Affairs in Tehran. He criticised Iranian regional politics but his criticisms were still published on the Iranian Foreign Affairs thinktank's website.

He said: "Iran overthrew the Shah. And now they are supporting Bashar al-Assad. Syria's government had been turning a blind eye to the welfare of its population which led to foreign interventions as we know them. I had been supporting the Islamic revolution for the past 37 years. But when I started to criticise Iranian positions, I got attacked."

Iran does not view the Syrian uprising as a popular revolution. It worries more about how Gulf states are supporting the Syrian opposition, how Sunni militant movements are rapidly expanding in the region, and how since 2011 Western countries have been silent about how the Shia population is being crushed by the authorities in Bahrain.

‘How can we call it a ‘Syrian’ uprising since during the first weeks, western diplomats were participating?” Mustapha Zahrani said. This was a reference to a visit to Hama, in July 2011 by Robert Ford and Eric Chevallier, the former American and French ambassadors in Syria.

Speaking on condition of anonymity, a member of the Islamic Research Institute for Culture and Thought (IRICT), a centre close to the Iranian sheikh Ali Akbar Rachad, is realistic: "Iran knows that it has partially lost the support of Sunni Arabs, among them the Muslim Brotherhood. Syria is a dictatorship. However for Iran, the war in Syria remains a defensive war. Our current main issue is our conflict with Saudi Arabia and the terrorist threat.”

The isolated case of Turkey and Palestine

Despite disagreements about Syria - and Yemen - some of the Muslim Brotherhood's representatives in the Arab world are still considered by Iran as representatives of a "moderate Islam". For instance, Tunisia's Ghannouchi still has some sort of intellectual credibility with the Iranian religious authorities.

He has maintained friendly relations with the Iranian diplomatic representation in Tunisia, even though he supports the Syrian opposition. In September 2015, he met with Mohammad Javad Zarif, Iran's foreign minister. In February 2016, he attended the ceremonies of the 37th anniversary of the Islamic revolution.

However, Iranian leaders fear that the Muslim Brotherhood might turn into a Salafist movement. In January 2016, Ayatollah Nasser Makaram Shirazi’s office - one of the main religious authorities in the country - published a series of brochures about "extremist and takfiri movements" that included a history of the Muslim Brotherhood.

The relationship between the Muslim Brotherhood and Iran has gone from mutual respect to mutual distrust, potentially fuelling the further polarisation between Sunni and Shia in the region.

There are however two notable exceptions to this decline in relations. The first, surprisingly, is Turkey. Its president, Recep Tayyip Erdogan, a member of the the AKP (Justice and Development Party), has become the guardian of the Muslim Brotherhood in Egypt, Syria and Tunisia. In Syria, his animosity against Assad is uncontested.

And yet, since 2011, Iran and Turkey have maintained diplomatic relations that go beyond mere cordial niceties. In March 2016, Turkish Prime Minister Ahmed Davutoglu went to Iran with five ministers and several Turkish businessmen. Economic partnerships and a common viewpoint on the Kurdish issue explain the good relations between Ankara and Tehran.

The second exception is Hamas. It is true that in November 2014, Salah Raqab, a member of its political office, accused Iran of trying to establish "a Persian empire" in the region, claiming that more Palestinians were becoming Shia Muslims. And yet Hamas and Iran have made one step towards a reconciliation.

In February 2016, Osama Hamdan, in charge of Palestinian foreign affairs for Hamas, went to Tehran. Immediately after meeting with the Iranian authorities, Hamas issued a straightforward press release: "We want a clean slate with Tehran."

The question of Palestine is deeply rooted in Iranian ideology. And even though they share a different point of view about the Syrian crisis, Hamas has never stopped receiving Iranian support.

Historical links between Iran and organisations claiming affiliation with the Muslim Brotherhood are not binary relationships. They are a mix of confessional suspicions, disagreement about the Syrian crisis and difficulties to discuss through Ankara or Gaza. Iran and the Brotherhood have not yet disappeared from the regional political scene: they need now to remain the best of enemies.

Translation from French (original) by Nassima Demiche.

The interviews mentioned in the article were carried out when a delegation from the When Authoritarianism Fails in the Arab World-European Research Council (WAFAW) went to Iran, although responsibility for its contents rests with the author alone. All rights reserved to the Middle East Eye.