It was however not very long before the caliphate in Baghdad fell to the Mongol hordes led by Hulagu in 1258. The Mongols who laid waste Iraq and the neighboring Muslim lands were however not able to destroy the caliphate. A scion of the Abbasids, Prince Mutawakkil III (1509-1543) whose line was fortunate enough to survive the Mongol slaughter still lived under the protection of their former slave army, the Mamelukes in Egypt where he ruled as the Caliph, but as a nominal one as real power was exercised by the Mamelukes who used his name to legitimize their rule. In 1517, when the Ottoman Sultan Selim I defeated the Mameluke sultanate, bringing Egypt into the Ottoman realm, Mutawakkil who was taken to Istanbul agreed to formally surrender the title of Caliph as well as its outward symbols, the Sword and Mantle of the Holy Prophet Muhammad (Peace be Upon Him) as soon as he died to the Ottoman Sultan. It was thus that the Ottoman Conqueror Selim became the Caliph of the Muslim World. The fame of the Ottomans as the Protectors of Islam soon spread far and wide for not only did they possess a good part of the Arab world including Syria, Iraq and Palestine, but also held the Cradle of Islam, the Hijaz whose two holy cities Mecca and Medina they dedicated to protecting, taking the humble title of Khadim-ul-Harameyn or Servant of the two sanctuaries.
The Sultans of Turkey were by now the acknowledged heads of the Islamic World and the bearers of the Caliphate instituted in the early days of Islam for its protection and propagation. It would appear that no sooner the Muslims of Serendib learnt that their new caliphs were Turks, they pledged them their loyalty, or even perhaps their allegiance, in spite of the fact that many of them were descended from Arabs, including those of the House of Hashim, the clan of the Noble Prophet Muhammad (Peace Be Upon Him).