The demise of the Ottoman Caliphate took place because of a slow erosion of power in relation to Western Europe, and because of the end of the Ottoman state in consequence of the partitioning of the Ottoman Empire by the League of Nations mandate. Abdulmejid II, the last Ottoman caliph, held his caliphal position for a couple of years after the partitioning, but with Mustafa Kemal Atatürk's secular reforms and the subsequent exile of the royal Osmanoğlu family from the Republic of Turkey in 1924, the caliphal position was abolished. Mustafa Kemal Atatürk offered the caliphate to Ahmed Sharif as-Senussi, on the condition that he reside outside Turkey; Senussi declined the offer and confirmed his support for Abdulmejid II.