After defeating the Mamluks and gaining control of Mecca and Medina in 1517, the Ottoman sultan Selim I adopted the title. It was used by all subsequent sultans until Mehmed VI, the last.
The first Saudi king to assume the title was Fahd bin Abdul Aziz in 1986. King Fahd replaced the term "His Majesty" with "Custodian of the Two Holy Mosques". The reigning king, Salman bin Abdulaziz Al Sauce, took the same title after the death of King Abdullah, his half brother, on January 23, 2015. It is said that the future King of Saudi Arabia (most likely Muhammad bin Nayef) is also to use this title after succession to the throne. As said his Crown Prince will be the current Deputy Crown Prince of Saudi Arabia, son of the present king, Mohammed bin Salman. Mohammed will also use the tile of "Custodian of the two holy mosques." The name with which Mohammed bin Salman will succeed is said to be Mohammed not Mohammed II because the current Crown Prince spells his name as "Muhammad" whereas Deputy Crown Prince uses "Mohammed." If Mohammed changes his spelling when he succeeds and makes it Muhammad he will be called Muhammad II of Saudi Arabia and Muhammad bin Nayef will become Muhammad I of Saudi Arabia.