The young prince already wielded huge power before he became heir, spearheading a sweeping economic and social reform programme for the ultraconservative kingdom.
His rise comes at a crucial time for Saudi Arabia which is in a battle for regional influence with arch-rival Iran, bogged down in a controversial military intervention in neighbouring Yemen and at loggerheads with fellow US Gulf ally Qatar.
Prince Mohammed is now "de factor ruler of the kingdom," said Andreas Krieg of the Defence Studies Department at King's College London.
Mohammed's youth is a novelty for a country that is used to ageing leaders -- King Salman is 81 and his predecessor King Abdullah died in 2015 aged around 90.
More From This Section
His rapid ascent over the past two years has symbolised the hopes of the kingdom's young population, more than half of which is under 25.
Saudi television channels showed the bearded Mohammed bin Salman kissing the hand of his ousted cousin Mohammed bin Nayef and kneeling in front of the older prince, who patted his shoulder to congratulate him.
The king called on governors and other princes to pledge allegiance to his new heir and ordered a ceremony - routine on such occasions - after night prayers on Wednesday at a royal palace in Mecca.
Many ordinary citizens tweeted their allegiance, but support for Mohammed has not been unanimous.
A royal order said his appointment was endorsed by 31 of 34 members on the Council of Allegiance, which decides on succession issues.
The enticements come as the kingdom's war in Yemen drags on and citizens for the first time pay taxes, imposed after oil prices fell.
Salman ordered the reinstatement of all civil service benefits cut in a controversial move as part of an austerity package late last year.
He also extended the end-of-Ramadan Eid Al-Fitr holidays until July 9 for civil servants.
As deputy crown prince, the new heir to the throne already held multiple posts.
He is the main champion of the kingdom's Vision 2030 reform plan to bring social and economic change to the oil- dependent economy of a country where women's rights are among the most restricted in the world.