A visit last week to Saudi Arabia by Hamas political chief Khaled Meshaal and other leaders of the movement appears to mark a significant warming of relations.

It was the first visit in three years, and coincided with the historic Iranian nuclear deal, whose main losers could turn out to be Saudi Arabia and other Sunni Gulf States.

Saudi Arabia is seeking to limit growing Iranian influence in the Arab region by re-invigorating ties with Egypt and Turkey. Riyadh also wants to re-embrace the Palestinian resistance, after Tehran supported it at a time when Arab states abandoned it and accused Hamas of terrorism.

Meshaal was accompanied by senior officials Moussa Abu Marzouk and Saleh Aruri, who Israel sees as responsible for the military infrastructure of Hamas in the West Bank; as well as Izzat Al-Rishq and Mohammad Naser, responsible for relations with Arab countries.

The visit by Hamas’s leaders continues a recent warming of relations between Saudi Arabia and the organisation that runs the Gaza Strip. Saudi Arabia played a major role in pressuring Cairo to cancel an Egyptian court’s ruling that Hamas was a terrorist organisation. It also helped to open the door of communication between Cairo and Hamas, which had closed after president Mohamed Morsi was deposed by the Egyptian army in 2013.

“On more than one occasion, Hamas confirmed its commitment to developing its relations with Saudi Arabia, overcoming the previous apathy,” Mahmoud al-Zahhar, one of the leaders of Hamas in Gaza, told MEE.

“Hamas knows the importance of the Saudi role in the Arab region. The [former] Saudi Foreign Minister Saud al-Faisal [who died on 9 July] stressed repeatedly ‘a national Palestinian resistance',” he said.

Some commentators have argued that while Mohammed Deif, commander of the Izz al-Din al-Qassam Brigades, the military wing of Hamas, did not want to give up Iranian backing, Hamas wants to diversify its sources of support in order to strengthen its military in Gaza.

Hamas acknowledged last summer it had received military aid from Iran during “the [2014] Gaza war” with Israel. Even so, Hamas’s relations with Iran became strained due to its opposition to Tehran’s policy on Syria, according to the observers.

Saudi pressure on Egypt

Hamas has since strengthened its relationship with the royal family in Saudi Arabia, and moved away from Iran, one observer said.

“Iran has become the main financier of Hamas. Therefore, the movement didn’t cut its relationship with Tehran. Hamas is waiting to change the Saudi position, even change the Egyptian position and open the Rafah crossing,” he said.

After the death of Saudi King Abdullah in January, Hamas asked Riyadh to put pressure on Cairo to open the Rafah crossing between Egypt and the Gaza Strip, which Egypt had closed after president Morsi’s removal from office, according to the observer.

In June, an Egyptian court dropped the charge that Hamas is a "terrorist" group and since then the Rafah crossing has been opened several times.

The Israeli Haaretz newspaper previously said that Saudi efforts to confront Iran led it to pressure Egypt to reach a rapprochement with Hamas.

On 24 June, Zvi Bar'el, Arab affairs analyst with Haaretz, said the “honeymoon” between Egypt and Hamas was sponsored by Saudi Arabia as part of its efforts to address Iranian expansion in the region.

Bar'el reported that during a visit to Egypt to meet President Abdel Fattah al-Sisi and Foreign Minister Sameh Shoukry, Saudi Foreign Minister Adel al-Jubeir pushed for a reconciliation between Hamas and Egypt; however, Sisi refused categorically due to Hamas being part of the Muslim Brotherhood movement, which Egypt considers a "terrorist organisation”.

According to the newspaper Al-Monitor, Hamas wants to revive its Saudi ties so as to bring an end to the siege of Gaza, heal the split with Fatah, improve links with Egypt, as well as stem the financial crisis facing Hamas following an end to Iranian support.

Meshaal's visit

“The causes of the current Meshaal visit to Riyadh lies in the Palestinian-Palestinian reconciliation, mediation and Saudi Arabia calling for the return of the relationship with Cairo and the opening of the Rafah crossing, and coordination of the post-Iranian nuclear deal,” a Hamas leader, who requested anonymity, told MEE.

Yassin Abdel-Qader, the Palestinian political thinker, said that the results of the visit will be more positive for Hamas than Saudi Arabia.

“The most important results lie in the renewal of the previous agreement between Hamas and Cairo about security coordination on the Rafah border,” Abdel-Qader said.

For his part, Ismail al-Ashqar, a leader of Hamas, told MEE that his movement "is still sticking to Saudi Arabia's leading role in the region, Saudi’s care for the Palestinian reconciliation”.

Al-Ashqar said in a press statement that "Hamas consider the Kingdom of Saudi Arabia as an Arab country that can’t be dispensed with, and that the relationship with it has seen a significant positive development”.