The ruler of a Muslim community, regarded as the successor of Muhammad was the caliph.
The caliph ruled in Baghdad until 1258 and in Egypt until 1517, the year of the Ottoman conquest. Ottoman sultans held the title afterwards until it was abolished in 1924 by Atatürk.