Hamas said its leader shook hands with Saudi Arabia’s King Salman after Muslim holiday prayers in Mecca, signaling an easing of tensions over the Palestinian group’s ties with Saudi regional rival Iran.

Mashaal was joined by a delegation of officials from the Palestinian terror group.

“The delegation discussed Palestinian unity and the political situation in the region. This meeting will hopefully develop relations between Hamas and Saudi Arabia”.

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.

It is four years since a Saudi monarch last had publicly acknowledged talks with Hamas, which runs the Gaza Strip.

The Hamas delegation encompassed Khalid Mishaal, Mousa Abu Marzouq, Saleh Al-Arouri and Mohammed Nazzal.

The exiled Meshaal has been based in Doha since he abandoned his base in Damascus in 2012 after the group sided with Syrian rebels against President Bashar al-Assad.

Top Hamas officials reportedly met with senior Saudi leaders Friday, the first such meeting in years.

The meeting comes just two days after Western powers signed a deal with Iran over its nuclear deal that will eventually result in the lifting of all sanctions now employed against the Ayatollahs.

Much of Hamas’s senior leadership decamped to Qatar.

But despite Mashaal’s stance, top officials in Hamas’s military wing, the Izz ad-Din al-Qassam Brigades, have recently been courting Iran in hopes that the Islamic Republic will provide substantial financial aid in order to rebuild the group’s armed forces in the Strip.