At the same time, Hamas’ relationship with Egypt went from being in permanent crisis during Mubarak’s era to a gradual alliance under Morsi. But the recent coup in Egypt turned Hamas’ dream of having a strong regional alliance network into a nightmare from which it has not yet awoken. Hamas has decided to reposition itself with regard to the alliances in the region so as not to lose its long-sought gains in less than two years.

Like any major historic event, the Arab revolutions reshaped the regional landscape. Because of its position with regard to the Syrian crisis, Hamas slightly moved away from the defiance axis, without completely breaking with it .

Hamas greatly benefited from its membership in the defiance axis. Based in Syria, Hamas received substantial funding from Iran and was able to train its fighters by having close ties with Hezbollah in Lebanon.

In less than two years, Hamas has repositioned itself within the regional alliances network. After being considered part of the Iran-led “defiance axis” that includes Syria and Hezbollah, Hamas found itself gradually moving toward another axis (which has not chosen a specific name for itself) represented by Mohammed Morsi’s Egypt, Qatar and Turkey. That latter axis stood apart from the pre-Arab-Spring “axis of moderation” that was composed of Hosni Mubarak’s Egypt, Jordan and Saudi Arabia, although this has started to re-emerge after the coup in Egypt .

Hamas downgraded its relationship with Iran and Hezbollah in recent months, but it didn’t completely cut ties due to Iran and Hezbollah supplying Hamas’ military wing, the Qassam Brigades, with long-range rockets capable of striking the heart of Israel, as Hamas itself admitted. Hamas’ new allies — Egypt, Qatar and Turkey — did not supply it with such weapons.

It is clear that Hamas, which is passing through difficult circumstances, would like to see its lifeline restored. Hamas would be happy if its Iranian liaison official would pick up the phone and re-establish cooperation like it was before the Syrian revolution.

According to information received by Al-Monitor, that phone call has not occurred. Hamas leaders inside and outside the Palestinian territories are frustrated and are not hiding their financial difficulties. Egyptian-Iranian relations took a nosedive after Morsi severed diplomatic relations with Syria and expelled the Syrian ambassador in the last days of his rule.

Although Hamas’ rank-and-file accepted Morsi’s move, senior Hamas leaders were not enthusiastic about it. They considered Morsi’s action to be a strong blow to Hamas’ former ally Iran, which then sought to bring down Morsi by cooperating with his enemies and fighting his friends, including Hamas.

The coup against Morsi surprised Hamas and Iran saw it as an opportunity to punish him. A senior Muslim Brotherhood leader told Al-Monitor that Iran gave money to Morsi’s opponents, including those who stand against Iran ideologically.

Outreach efforts

Hamas’ alliance network is getting weaker. The group tried to rectify the matter by making a series of overt and covert moves to keep the line of communications with Iran open, especially with Hamas leaders such as Mahmoud al-Zahar, who has always called for maintaining contacts with Iran, even if minimal.

It should be noted that Zahar is not acting independently, as has been indicated by some reports, including one by Al-Monitor's Shlomi Eldar.

A senior Hamas official told this author that Zahar is highly respected in the movement although he no longer holds a leadership post and that his contacts with Iran are part of Hamas policy. The Hamas leadership wishes to mobilize all resources that serve the Palestinian cause and should not sever relations with anyone.

Another knowledgeable Hamas source who lives abroad told Al-Monitor that Hamas didn’t heed the invitation by the General Union of Muslim Scholars in mid-June to attend an international conference in Cairo to support the Syrian revolution. Hamas chose not to attend because it wished to mend its relationship with Iran. The conference recommended that young Arabs and Muslims be recruited to fight the Syrian regime.

Information shared with the author indicated that there was recently a series of meetings in Beirut bringing together officials from Hamas, Hezbollah and Iran. To discuss the strained relations, Hamas sent a high-level delegation headed by political bureau deputy Mousa Abu Marzouk to meet with a high-level Iranian delegation.

A source close to decision-making circles in Hezbollah told Al-Monitor that Abu Marzouk’s meeting with Hezbollah and Iranian officials in Beirut was to ensure that the relationship between the two sides remains strong at the highest levels and that the parties understand each other’s circumstances.

During this period, Hamas’ media was careful not to burn any bridges and did not attack Iran.

The reconciliation?

After the Muslim Brotherhood had opened Egypt’s doors to Iran and Morsi made a historic visit to Tehran, some Egyptians called on Iran to refrain from interfering in Egyptian internal affairs. Iran’s new Foreign Minister Abbas Araqchi said that Morsi’s ouster was a military coup and he rejected the army’s intervention in politics. He called for Morsi to be reinstated as he is the democratically elected president. Iran took that stance since it was still of the belief that Morsi was its closest friend in Egypt despite him being wrong on Syria.

Things grew worse between Tehran and Cairo in the last hours after Egyptian security services closed the Iranian Al-Alam channel in Egypt and arrested its director. Iran’s relationship with Egypt may worsen still.

The fact that both Hamas and Iran reject the new political order in Egypt may help repair Hamas-Iran relations. Tehran may try to exploit the Muslim Brotherhood’s decline in Egypt to convince Hamas that it would be better off with a strong relationship with Iran, given the prevailing geopolitical situation.

Hamas is not embarrassed to say that it needs Iran and that Iran needs Hamas, which couldn’t find a substitute for Tehran’s financial and military support. Turkey, Egypt and Qatar do not fit the bill. Turkey is preoccupied with protests. Egypt’s Muslim Brotherhood was ousted, and Qatar is in political transition.

Iran needs Hamas because it is the most organized and influential armed political movement in the Palestinian scene. Iran is seeing its Syrian ally being battered by the opposition and doesn’t want to lose more regional allies.

Egyptian restrictions on the Gaza Strip’s tunnels are pushing Hamas closer to Iran and Hezbollah. The efforts to improve relations by Iran and Hezbollah on the one hand and Hamas on the other suggest that their relationship was never completely severed, but only temporarily weakened.

The coup in Egypt has woken up both sides to the painful reality that they have no choice but to overcome past mistakes and resume their relationship. Egypt under Morsi was not completely on Hamas’ side and Hamas does not want Iran to be completely against it during new Iranian President Hassan Rouhani’s era.

Adnan Abu Amer is dean of the Faculty of Arts and head of the Press and Information Section as well as a lecturer in the history of the Palestinian issue, national security, political science and Islamic civilization at Al Ummah University Open Education. He holds a doctorate in political history from the Demashq University and has published a number of books on issues related to the contemporary history of the Palestinian cause and the Arab-Israeli conflict. On Twitter: @adnanabuamer1