It has also been revealed that the question of how best to approach its ties with Tehran has caused a widening rift within the ranks of the Islamist movement itself, leading to the emergence of what’s been called the " rejectionist" and "moderation " fronts inside Hamas.

With the rise of Rouhani and the fall of the Muslim Brotherhood in Egypt, and amid speculation over the future of this once very close alliance, analysts were in agreement that Hamas isn’t likely to completely cut its ties with Tehran. Many in fact have argued that Hamas will rebuild its ties with the Islamic Republic.

The Hamas movement has suffered major financial repercussions from its conflict with Iran. This comes alongside unfolding regional developments, especially in Qatar and Iran as well as the recent closure of the tunnels with Egypt. Nonetheless, the movement continues to find alternatives to compensate for the funding shortage.

Until very recently, Iran had been the main financial and military benefactor of the Islamist movement and its government, which has been in control of the Gaza Strip since 2007. Relations were dealt a huge blow, however, over their disagreements on the Syrian crisis. Iran has since significantly cut funding to Hamas.

Since Reformist-backed Hassan Rouhani was elected as Iran’s new president in mid-June, there has been much speculation as to the future of the relationship binding the Islamic Republic with the Islamist movement Hamas in the Gaza Strip.

For example, following Rouhani’s electoral victory, local news agencies reported that senior Hamas official Mahmoud Zahar congratulated the Iranian president on his win in “the free and fair elections and the trust granted to him by the Iranian people.”

From his June 16 statements, Zahar has been quoted as saying, “We will try to keep our relationship with Iran as special as it has been without the interference of any other courtiers,” in clear reference to the pressure from other regional and rising powers on the Islamist movement to bring to an end its alliance with Iran.

The hardcore senior Hamas leader added that the movement will reinforce its relations with Tehran, stressing that the movement needs to deal with “all governments of Arab and Islamic countries, and that it should not cut its ties with any government that supports the Palestinian people.”

In the same context, Al-Monitor’s Shlomi Eldar argued that Zahar is planning a comeback in the Hamas leadership with the backing of Iran. Zahar’s influence, he pointed out, has risen significantly among hardcore members inside Hamas over other leaders in the movement such as head of Hamas' political bureau Khaled Meshaal, Hamas Prime Minister Ismail Haniyeh and other heads of Hamas’ political bureau.

Zahar has been able to secure large sums of money in order to compensate for the shortage in funds and save the movement from the financial crisis with which it has struggled.

Eldar wrote, “Al-Monitor has learned that while Hamas’ traditional sources of funding are drying up, Zahar alone has managed to raise large sums of money from Tehran. Zahar took care to maintain his ties with Iran after he was deposed [from the Hamas Shura Council in April 2013], even though the leaders of his movement got into a bitter public feud with the Iranians."

In this regard, Zahar, accompanied by a delegation of 22 members, was reportedly banned by Hamas security from traveling to Iran to congratulate Rouhani on his presidential victory. Citing anonymous Hamas sources, Palestine Press News Agency reported that following the ban, Zahar refused to receive two senior Hamas officials, Ghazi Hamad — also deputy minister of foreign relations— and Ahmed Youssef, at his house.

Hamas officials have repeatedly turned down Al-Monitor’s requests to discuss its future relationship with the Islamic Republic, saying, “It would be unwise and harmful for the movement to comment on this issue in light of the volatile situation in neighboring countries.”

However, sources inside Hamas told Al-Monitor that there has not been an official stance yet by the Islamist movement on the election of Rouhani as the new president of Iran, but they hoped the new Iranian president “would pursue a policy more balanced than that of his predecessor, who pursued a tough policy with Hamas.”

“We hope to have close relations with Tehran because it is not in our interest to lose Iran’s support ... and we hope that Iran’s financial and military support will continue since Israel constitutes a threat to Iran, and both us and the Islamic Jihad in Gaza are important factors in strengthening Iran’s role in the region,” the source stated.

The same tone was reflected by Munir Saeed, member of Hamas political bureau, who believes that Hamas-Iranian relations are likely to be strengthened under Rouhani’s term.

In an interview published on July 2 in the pro-Hamas Gaza-based Felesteen newspaper, Saeed stated that although the movement’s relations with Iran deteriorated due to disagreements over Syria, Iran will always maintain its ties with Hamas and support resistance against Israel insofar as it remains in the anti-Israel alliance.

According to Saeed, the movement currently seems to be pinning its hopes on the role that Rouhani will play in strengthening relations with the movement.

“Rouhani’s victory,” the Hamas official added, “has several implications. It suggests that the public opinion in Iran — the 51% of the electoral vote that gave Rouhani their voice — disagree with his conservative predecessor’s policies. It suggests that there is change happening in Iran, but to what extent will this change affect Iran’s foreign relations remains in the sphere of speculation.”

Gaza-based analysts believe it is unlikely that Rouhani’s election as president will significantly impact the movement’s relations with Tehran, particularly since everything “runs down to Syria and the party’s stance on the Syrian conflict.”

Political commentator Hani Habeeb believes that Hamas-Iranian relations are not going to improve under Rouhani as long as Hamas refuses to ally itself with the regime of President Bashar al-Assad in Syria. However, it is also unlikely that they will completely sever ties, since there are certain elements inside Hamas that are taking care of the movement’s ties with both Iran and Hezbollah.

Habeeb added that Rouhani’s rise to power will not change Iran’s foreign policy since such policies are determined not by the president but rather by the Islamic Republic’s supreme leader.

“Supreme Leader Ali Khamenei shapes Iran’s grand policies, not the president,” Habeeb told Al-Monitor. “Therefore, I don’t think his election will impact Iran’s relations with Hamas. And at the end of the day, in this case, everything runs down to Hamas’ stance on the Syrian question. If they refuse to ally themselves with Assad, change is unlikely to happen.”

Mohammed Suliman is a Gaza-based writer and human rights worker. Mohammed obtained a masters degree in human rights from the London School of Economics. His writings appeared on different online publications including Al Jazeera English, openDemocracy, the Electronic Intifada and Mondoweiss. On Twitter: @imPalestine