Recent foreign policy decisions by the United States have opened yet another chapter in the long history of the competition for the guardianship over Islam's holiest places. After the US recognised Jerusalem as Israel's capital and moved its embassy there, the question of who gets to control the holy sites in the city (the third holiest in Islam after Mecca and Medina) has come to the fore.
Currently, King Abdullah II of Jordan is the custodian of the Muslim and Christian holy sites in occupied Jerusalem, but there are growing speculations that the "deal of the century", which the Trump administration has promised would offer a solution to the Palestinian-Israeli conflict, might usher in the transfer of guardianship to the House of Saud.
In March, King Abdullah hinted at the ongoing tensions between Amman and Riyadh over the issue by saying that he had been put under pressure to change his position on occupied Jerusalem. Then in April, King Mohammed VI of Morocco also stepped into the fray by announcing a grant of an undisclosed amount to be made available for the restoration of Al-Aqsa Mosque and its compound - a first of its kind for the past many years.
Apart from Jordan, Saudi Arabia and now Morocco, Turkey is also seemingly vying for influence in Jerusalem. All four have historical claims to leadership in the Muslim world and all four seem intent on playing a major role in the future of the holy city.
It is not the first time that the House of Saud and the House of Hashim have clashed over Islam's holy sites. King Abdullah's ancestors, the Hashemites, who are considered to be descendants of the Prophet Muhammad, ruled Mecca for centuries before they were deposed by the Saudis. In the 1920s, Abdul Aziz Ibn Saud, the father of Saudi King Salman, challenged the rule of Sharif Hussein bin Ali, the great-great-grandfather of King Abdullah in Mecca and the whole of the Hijaz region (the westernmost part of modern Saudi Arabia), eventually defeating his forces and expelling the Hashemites from the holy city.
Two of Sharif Hussein's sons established monarchies in Iraq and Transjordan with the help of Britain, but only the latter has survived to this day. The Jordanian monarchy acquired the custodianship over Christian and Muslim holy sites in Jerusalem in 1924 after the collapse of the Ottoman Empire, which had ruled over Palestine for centuries.
Both the Hashemites and the Saudis also share historical animosity against the Ottomans. In 1517, the Ottoman Sultan Selim I took control of Mecca and Medina and solidified the Ottoman claim to the caliphate; the Hashemites were forced to pay him allegiance. Four centuries later, Sharif Hussein of Mecca led the Arab rebellion against the Ottomans, aided by the British Empire. The Saudis, too, clashed with Ottoman forces throughout the 19th century and early 20th century, as they tried to expand territories under their control. Although the caliphate was dissolved and the Ottoman Empire transformed into a secular republic in 1924, in recent years the Turkish government has sought to regain a leadership position within the Muslim world.
Despite the fact that the Moroccan Alaouite dynasty was a distant observer to this struggle between the Ottomans, the Saudis and the Hashemites over Islam's holiest sites, it, nevertheless, managed to develop and maintain a special relationship with Jerusalem, as well. The ancestors of King Mohammed VI who, like the Hashemites, traced their lineage to the Prophet Muhammad, supported the holy sites in the city and its inhabitants for centuries.
Eventually, a Moroccan Quarter emerged in Jerusalem which hosted many Muslims from the Maghreb. When the Israeli government destroyed it after the 1967 war, many of its inhabitants were re-settled by King Hassan II (King Mohammed's grandfather) in Morocco. The historic role Rabat has played in supporting the holy city was recognised in 1975, when a summit of the Organisation for Islamic Cooperation (OIC) chose the Moroccan king to head the newly established Jerusalem Committee, which was tasked with addressing various challenges the city faced under Israeli occupation.
Today, some of these old rivalries and claims to historical legitimacy have resurfaced, although the geopolitical situation has changed significantly since the early 20th century. Thanks to its massive oil revenue, Saudi Arabia has emerged as one of the most powerful countries in the Arab world.
In the late 1960s, Riyadh intensified its "chequebook diplomacy", supporting financially former foes like Egypt and Jordan to help them recover from the defeat in the 1967 Arab-Israeli war. In recent years, Saudi funds have helped both Cairo and Amman stabilise their struggling economies amid political upheaval.
While Jordan has been hard-pressed to accept the financial assistance, it has watched with ever-increasing anxiety Saudi efforts to gain more influence in Jerusalem over the past few years.
In December 2017, less than two weeks after the US officially recognised Jerusalem as Israel's capital, the House of Saud made clear its intention to challenge Hashemite custodianship during a meeting of the Arab Inter-Parliamentary Union, a body bringing together members of parliament from Arab countries. At the event, the Saudi delegation snubbed their Jordanian counterparts by objecting to the mention of Jordan's historical role vis-a-vis the holy city in draft documents.
A few months later, Saudi Arabia announced a grant of $150m to support the administration of Jerusalem's Islamic properties. Meanwhile, the Saudi crown prince has sought to intensify Saudi-Israeli rapprochement and has seemingly supported the US "deal of the century".
Jordan now fears that the Trump administration, with Israel's approval and Saudi Arabia's encouragement, may propose to establish an administration under Saudi supervision over Jerusalem's Islamic holy places, which would not only diminish the Palestinian Authority is playing in Jerusalemite affairs, but also effectively cancel Jordanian custodianship.
In response, Jordan has sprung into action, getting more involved in Jerusalem issues and seeking regional support. In February, it announced a new Islamic Endowment Council made up of important Palestinian figures (including some who participated in the mass protests against the metal detectors Israel installed at Al-Aqsa Mosque in 2017) and tasked with tackling some of the most pressing issues occupied Jerusalem is facing.
In March, King Abdullah travelled to Morocco and met King Mohammed VI, seeking his political backing. The Moroccan king obliged and affirmed officially that defending Jerusalem was a "top priority" for his country. A month later, he made the announcement about the special grant to help with restoration work on Al-Aqsa Mosque.
On the Jerusalem issue, Jordan has also sought support from another important regional player: Turkey. In February, King Abdullah visited the country to discuss the Palestinian issue, among other issues. Previously, the Jordanian king attended both meetings of the OIC Turkish President Recep Tayyip Erdogan called in order to discuss the status of Jerusalem and worrying developments in Palestine, despite reportedly being pressured by Saudi Arabia not to do so.
Turkey itself has been vying for a leadership position within the Islamic world for years now and Palestine has been a special focal point of these efforts. Turkish charities have become increasingly active in Gaza and the West Bank, as have various Islamic organisations with sizeable budgets. Ankara has encouraged religious tourism to Jerusalem and has funded various humanitarian initiatives, including the construction of a dormitory for Al-Quds University students, the provision of meals for Ramadan, the renovation of historical sites and houses, etc. It also gave Palestinians access to Ottoman archives which documented land ownership, which could help in the struggle against Israeli land expropriation.
All these efforts and Turkey's rising popularity in Palestine are worrying Saudi Arabia, especially because the two countries are now part of two opposing axes in the Middle East. This rift was solidified further in 2017 when Saudi Arabia, the UAE, Bahrain and Egypt imposed a blockade on Qatar.
Ultimately, what happens next in the scramble for Jerusalem will be very much determined by the provisions of the "deal of the century", expected to be revealed next month. Whatever the US proposals are for the administration of the holy sites of Jerusalem, it would certainly fuel further the growing divisions between Arab countries, which just a decade ago were in full agreement on the status of Jerusalem and the prerequisites for peace with Israel.
The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial stance.