Sharifate of Mecca The Sharifate of Mecca or Emirate of Mecca was a state , non - sovereign for much of its existence , ruled by the Sharifs of Mecca . A sharif is a descendant of Hasan ibn Ali , Muhammad ' s grandson . In Western sources , the prince of Mecca was known as Grand Sherif , but Arabs have always used the appellation " Emir " . The Sharifate existed from about 968 to 1925 . From 1201 , the descendants of the Sharifian patriarch Qutada ruled over Mecca , Medina and the Hejaz in unbroken succession until 1925 . Early history . Originally , the sharif s of the Hejaz had generally avoided involvement in public life . This situation changed in the second half of the 10th century , with the rise of the heretical Qaramita sect . The Qaramita directed tribal raids towards Iraq , Syria and much of Arabia , interrupting the flux of pilgrims to Mecca . In 930 , Qaramita raiders attacked Mecca , and stole the holy Black Stone from the Kaaba , gravely embarrassing the Abbasid caliph in Baghdad . Abu al - Misk Kafur , an Abbasid vassal and ruler of Egypt , persuaded the Qaramita to end their raids and return the Black Stone to Mecca in return for an annual tribute . As a measure to enhance the safety of the pilgrims he chose one of the sharifs of Hejaz , Jaafar al - Musawi , and installed him as emir of Mecca in about 964 . When the Ismaili Shia Fatimids conquered Egypt in 973 , they began to appoint the sharifs of Mecca from the descendants of Jaafar al - Musawi . In 1012 , the Emir of Mecca Abdul - Futuh declared himself caliph , but he was persuaded to give up his title in the same year . The first Sulayhid ruler conquered the whole of Yemen in 1062 , and proceeded northwards to occupy the Hejaz . For a time , they appointed the Emirs of Mecca . As Sunni power began to revive after 1058 , the Meccan emirs maintained an ambiguous position between the Fatimids and the Seljuks of Isfahan . After Saladin overthrew the Fatimids in 1171 , the Ayyubids aspired to establishing their sovereignty over Mecca . Their constant involvement in dynastic disputes , however , led to a period free of external interferences in the Hejaz . In 1200 circa , a sharif by the name of Qitada ibn Idris seized power and was recognised as Emir by the Ayyubid sultan . He became the first of a dynasty that held the emirate until it was abolished in 1925 . The Mamluks succeeded in taking over the Hejaz , and made it a regular province of their empire after 1350 . Jeddah became a base of the Mamluks for their operations in the Red Sea and the Indian Ocean , leading it to replace Yanbu as the main maritime trade centre on the Hejaz coast . By playing off members of the sharifian house against one another , the Mamluks managed to achieve a high degree of control over the Hejaz . Ottoman era . During the Ottoman period the Emirate was not hereditary , and owed its succession to direct nomination by the Ottoman Porte . A dual system of government existed over the Hejaz for much of this period . Ruling authority was shared between the Emir , a member of the ashraf or descendentants of prophet Muhammad , and the Ottoman wali or governor . This system continued until the Arab Revolt of 1916 . Apart from the Emirs of Mecca , Ottoman administration in the Hejaz was first at the hands of the Governor of Egypt and then the Governors of Jeddah . The Eyalet of Jeddah was later transformed into the Hejaz Vilayet , with a governor in Mecca . For much of the 19th century , the northernmost place of the Emirate was Al - Ula , while the southern limit was usually Al Lith , and sometimes Al Qunfudhah ; to the east , it never stretched further than the Khaybar oasis . Mecca , Medina and Jeddah were its largest cities . Most of the population of these cities consisted of non - Arab Muslims , including Bukharis , Javanese , Indians , Afghans , and Central Asians . Early period . The Hejaz region was formerly under the Mamluk Sultanate until its defeat and take over by the Ottomans in 1517 . In the same year , Sharif Barakat of Mecca acknowledged the Ottoman Sultan as Caliph . When the Sharifs accepted Ottoman sovereignty , the Sultan confirmed them in their position as rulers of the Hejaz . Ottoman authority was only indirect , as the arrangement left real power with the Emir . The Sultan assumed the title of " Hâdimü ’ l - Haremeyni ’ ş - Şerifeyn " , or Custodian of the Two Holy Cities . In 1630 , a flood swept Mecca , almost completely destroying the Kaaba . It had been restored by 1636 . In 1680 , about 100 people drowned in another flood in Mecca . Initially , the Ottomans administered the Hejaz under the Eyalet of Egypt . The Emirs were appointed by the Sultan taking into consideration the choice of the sharif s , as well as the opinions of the walis of Egypt , Damascus and Jeddah ( after it was established ) , as well as that of the qadi of Mecca . The emir of Mecca was always from the Hashemite clan of the prophet Muhammad . This situation was ended in 1803 , when fundamentalist Wahhabis deposed the ruling Emir of Mecca , Sharif Ghalib . Wahhabi invasion and Egyptian control . The Wahhabis started to be a threat on the Hejaz from the 1750s onwards . They had risen as a religious movement in Dira ’ iyya in the Nejd in 1744 - 1745 . Their doctrine found few sympathisers in the Hejaz , and the Mufti of Mecca pronounced them heretics . They were able to take the two holy cities in 1801 . In 1803 the Wahhabis , led by Abdul - Aziz Al Saud , attacked Mecca . Sharif Ghalib fled to Jeddah , which was besieged shortly thereafter . Sharif Ghalib was sent back to Mecca asa a Saudi vassal . First Tosun Pasha led the army in 1811 and occupied Medina in 1812 and Mecca in 1813 . After his death İbrahim Pasha , who had accompanied Mehmed Ali ’ s personal visit to the Hejaz in 1814 , took over and chased the Wahhabis into the Nejd . Upon the news of the victory , Mahmud II appointed İbrahim Pasha governor of Jeddah and Habeş . He was the nominal ruler of Hejaz on behalf of the Ottomans from 1811 to 1840 . The Wahhabi were ousted from the Hejaz in 1818 , when Mehmed Ali Pasha , by then Governor of Egypt , was able to succeed in final victory . The Hejaz then fell under his domination . The 1840 Convention of London forced Mehmed Ali to pull out from the Hejaz . Vilayet of Hejaz . After the Hejaz was restored to the Ottomans , the provincial administration was restructured , and it was organised as the Vilayet of Hejaz . This led to the creation of two parallel political and administrative bodies : the Emirate and the Vilayet . After the Governor started to reside in Mecca , the Vilayet in a way took the Emirate into its jurisdiction , leading to a situation of dual government . The reform provided for the loss of the near - autonomy of the Emir , leading to a conflict between Emir and wali that lasted for the rest of the 19th century . Even then , the Emir of Mecca was not relegated to a position where he would be subordinate to the wali . The Emirs of Mecca continued to have a say in the administration of the Hejaz alongside the governors . The two had an uneasy parallel coexistence : while ruling over the same geography , they divided authority in a complex way , leading to a continuous negotiation , conflict or cooperation between them . As early as the 1880s , there was talk of British occupation of the Hejaz with the support of the şerifs . The British also challenged the Sultan ’ s caliphate by claiming that Britain should appoint the Emir , as it ruled over four times as many Muslims as the Ottomans . Kingdom of Hejaz . On 23 December 1925 King Ali surrendered to the Saudis , bringing the Kingdom of Hejaz and the Sharifate to an end . List of Sharifs . Partial list of Sharif of Mecca :