Hamas' leader in exile Meshaal
Hamas' leader in exile MeshaalReuters

Hamas leader Khaled Meshaal, met Saudi King Salman during a pilgrimage to Mecca, in a rare encounter since a two-year rift, state news agency SPA reported Saturday.

It said Meshaal headed a Hamas delegation on a two-day visit for the mini-pilgrimage to the Muslim holy city of Mecca in the west of the kingdom.

"The delegation offered Eid greetings" to King Salman during prayers at the Grand Mosque, SPA said, referring to the feast which started Friday following the Muslim fasting month of Ramadan.

It said they also "praised the positive stance of the kingdom's leadership towards the Palestinian cause."

A Hamas statement said the delegation, including Meshaal's deputy Mussa Abu Marzuk, also met Crown Prince Mohammed bin Nayef and Deputy Crown Prince Mohammed bin Salman , the king's son and defense minister.

Ties between Hamas and Riyadh deteriorated after the kingdom threw its support behind the Egyptian army's 2013 ouster of Islamist president Mohamed Morsi and its crackdown on his Muslim Brotherhood.

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.

But the rise of Islamic State (ISIS) may have brought the two together, according to reports Thursday, as Hamas has been battling the rival Islamist group from within Gaza, and Saudi Arabia faces threats from the terror group over its version of Islamic Sharia law, which ISIS insists is not strict enough. 

AFP contributed to this report.