Saudi Arabia's King Salman ousted his nephew as crown prince on Wednesday and installed his son Mohammed bin Salman, capping a meteoric rise for the 31-year-old that puts him one step from the throne.
The young prince already wielded huge power before he became heir, spearheading a sweeping economic and social reform program for the ultraconservative kingdom.
His rise comes at a crucial time for Saudi Arabia, which is in a battle for regional influence with archrival Iran, bogged down in a controversial military intervention in neighboring Yemen and at loggerheads with fellow US Gulf ally Qatar.
Prince Mohammed is now "de facto ruler of the kingdom," said Andreas Krieg of the defense studies department at King's College London.
"The king needed to strengthen his son's position amid the current turmoil in the region," Krieg said.
Mohammed's youth is a novelty for a country that is used to aging leaders — King Salman is 81, and his predecessor King Abdullah died in 2015 aged around 90.
His rapid ascent over the past two years has symbolized 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.
"I am going to rest now. May God help you," the former crown prince said, to which his replacement replied: "May God help you. I will never do without your advice."
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 king accompanied his son's elevation with measures to woo the many Saudis who work for the government, either as civilian or military personnel.
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.
One Saudi, Sultan al-Asimi, 33, said in Mecca that Mohammed's appointment sends a message of "hope and trust about the future of the country."
The Saudi stock market seemed to agree. It closed 5.5 percent higher on news of Mohammed's appointment as well as word that the exchange had moved closer to joining a major global index.
Mohammed is also defense minister with overall responsibility for the kingdom's military intervention in Yemen.
Sunni-dominated Saudi Arabia leads a coalition supporting the Yemeni government against Shiite rebels who control the capital Sanaa.
The coalition's bombing campaign has drawn repeated criticism from human rights groups for the high number of civilian casualties.
Saudi Arabia's intervention in Yemen in March 2015 signaled a more aggressive foreign policy, emphasized again this month when the kingdom and its allies imposed an embargo on neighboring Qatar.
They accused Doha of supporting extremists, a charge it denies.
Mohammed's appointment as heir to the throne completes a gradual stripping of power from the ousted crown prince, Mohammed bin Nayef, 57, who has also been fired as deputy prime minister and interior minister.
An April government and security shakeup prepared the way for Mohammed bin Salman's rise, when a number of his allies were appointed to prominent positions and a brother was named ambassador to Washington.
While the exact timing of such a move had been uncertain, "it has been expected for a long time," said analyst Riad Kahwaji, founder of the Institute for Near East and Gulf Military Analysis (INEGMA).
Salman had already set a precedent for removal of a crown prince when, in April 2015, he appointed Mohammed bin Nayef and fired Prince Moqren bin Abdul Aziz bin Saud, an appointee of King Abdullah.
Prince Abdulaziz bin Saud bin Nayef — the ousted interior minister's nephew — was named to replace him.
He takes control of the security forces while the kingdom faces periodic shootings and bombings claimed by ISIS, as well as discontent among its Shiite minority.