DUBAI - Hamas chief Khaled Meshaal and other top officials from the Palestinian militant group met with Saudi Arabia’s King Salman and senior Saudi leaders on Friday, a Hamas source said, in the first meeting between the two sides for years.

The meeting brought together top members of Hamas political wing with the Saudi king , crown prince and defence minister in a possible rapprochement between the conservative United States-allied kingdom and the traditionally Iran-allied party.

“The delegation discussed Palestinian unity and the political situation in the region. This meeting will hopefully develop relations between Hamas and Saudi Arabia,” the source told Reuters. Hamas has ruled the Gaza Strip since 2007 after fighting a brief and bloody civil war with Palestinian rivals in Fatah and has fought three wars with Israel, which it has vowed to destroy.

The group was jolted by civil war and rivalries in the wake of the Arab Spring in 2011 and relations with Iran soured over its refusal that year to back Tehran’s ally, Syrian President Bashar al-Assad, in his war against mainly Islamist rebels. Much of Hamas’s senior leadership decamped to Qatar, but the tiny gas-rich state was under pressure from fellow Gulf Arab countries to reduce its support for Islamist groups.

Relations between Hamas and Saudi Arabia have improved since Salman assumed the Saudi throne in January and the kingdom has taken on a newly assertive posture in the region. Saudi Arabia has led an Arab military intervention in Yemen and is fiercely opposed to what it views as Iranian encroachment in the Arab world, despite a deal agreed this week between Tehran and world powers over its disputed nuclear programme. Moreover, A senior Hamas official said Friday there could be no new exchange talks with Israel until it frees dozens of prisoners it has rearrested since their release in a 2011 swap. Ismail Haniya, a former Palestinian prime minister, said Israel had re-arrested at least 54 of the more than 1,000 prisoners freed in exchange for soldier Gilad Shalit, who was captured in a cross-border raid by Gaza militants in 2006.

“We have told all the mediators who have mobilised to discuss a new exchange that there won’t be any negotiations before the release of all those Israel detained from among the Shalit deal group,” he said in a speech marking the Eid al-Fitr holiday.

“There will be no talks without their unconditional release.” Haniya did not elaborate on what new exchange was being mooted. Hamas has long acknowledged holding body parts of two Israeli soldiers killed during last summer’s conflict in Gaza. But it has not commented on Israel’s announcement last week that Hamas is also holding two of its citizens in Gaza.

Hamas and Israeli sources have reported informal, indirect contacts on the possibility of a long-term truce between them, to cement an Egyptian-brokered ceasefire that ended the Gaza conflict last August. Last Thursday, the Israeli defence ministry said that Avraham Mengistu, an Israeli of Ethiopian descent, had been held by Hamas since crossing illegally into Gaza last September.

It said an Israeli Arab is also being held, although it has given no details of his case. Israel does not allow its citizens to enter Gaza, partly out of fear they may be used as bargaining chips to demand concessions, including the release of prisoners. Israel insists that all of those rearrested since the Shalit exchange were implicated in fresh security offences committed after their release.