Saudi Arabia's new heir to the throne Crown Prince Mohammed bin Nayef, a close friend of the United States and a scourge of Islamist militants, will be the country's first king from the third generation of its ruling dynasty.
King Salman bin Abdulaziz, in a decree on Wednesday, appointed his nephew and Interior Minister Prince Mohammed as heir apparent, replacing the monarch's half-brother Crown Prince Muqrin in a shake-up at the top of the world's biggest oil exporter.
The move, three months after he took the throne following the death of King Abdullah and coming as Saudi Arabia leads a military campaign against Iranian-allied Houthi militias in Yemen, appeared to settle for many years to come tough decisions over the kingdom's succession.
By sending an assassin to try to kill Prince Mohammed when he was Saudi security chief in 2009, al Qaeda paid him the compliment of treating him as one of its most dangerous enemies.
The prince narrowly survived that attack, in which a militant approached him claiming he wanted to defect before detonating a bomb concealed under his clothes, and was named Interior Minister in November 2012.
The 55-year-old is now firmly established as the most powerful member of his generation in the ruling al-Saud family, and even before he becomes king will be one of the most important figures in the kingdom.
He is the first grandson of Saudi Arabia's founding monarch, King Abdulaziz, or Ibn Saud, to join the line of succession. Abdulaziz established the kingdom in 1932 and ruled until his death in 1953, a period in which Saudi Arabia assumed growing geopolitical importance because of its huge oil resources, developed with U.S. partners.
Mohammed, who was named as first deputy prime minister, remained in his position as Interior Minister, Wednesday's decree said.
A March 2009 U.S. embassy cable released by WikiLeaks described Prince Mohammed as already being the de facto interior minister and said he was "held in high regard by Saudi King Abdullah ... and well respected by the Saudi populace".
Yet despite his constant contacts with Western - particularly American - officials and a prominent media presence through his security role, Prince Mohammed remains something of an unknown quantity.
Diplomats and Saudi analysts and academics are uncertain what positions he holds on the big long-term issue facing the kingdom: reconciling social change and a young population with conservative traditions and an oil-dependent economy.
"I would assume he's from the second generation of princes who are more receptive to ideas of reform. But he is good at making everybody think he is in their camp. That's what makes a successful politician," said Jamal Khashoggi, general manager of al-Arab News, when Prince Mohammed was appointed in 2012.
Along with Defence Minister Prince Mohammed bin Salman, who was appointed deputy crown prince on Wednesday, Prince Mohammed is now the youngest member of the select group of royals at the top of government who control some of the most important portfolios, including intelligence and defence.
But while his promotion to minister pleased some allies, such as the United States with whose security forces he worked closely, it also worried some Saudis who feared his security-conscious approach would impinge on civil liberties.
The prince, a son of the late Crown Prince Nayef who had served as interior minister since 1975 until his sudden death from a heart attack in 2012, has come to be closely identified with the formidable structure his father created.
During his two years in charge of the ministry, the government's tolerance for dissent has shown no sign of loosening as a steady stream of activists have been detained and imprisoned on charges that include talking to foreign media.
But unlike the late Nayef, who was widely regarded as an instinctively conservative man who took policy cues from the country's powerful clergy, Prince Mohammed was educated in the United States, receiving a degree in political science in 1981.
An old friend of the interior minister described him as a fan of Hollywood action films and a gun enthusiast, who built a private shooting range at his palace.
Whatever his personal views, however, Prince Mohammed has followed his father's example of keeping close ties with conservatives, a group often seen in Saudi ruling circles as posing the biggest potential threat to the government.
Religious conservatives were behind uprisings in 1927 and 1979 and backed the Islamist sahwa protest movement of the 1990s, while the most recent serious challenge to Saudi rule came from al Qaeda last decade.
The prince's friend says his office is still staffed by ultra-conservative men.
In a ruling family where big policies are developed through consensus, Prince Mohammed's views may shape foreign policy too.
U.S. embassy cables released by WikiLeaks show him to be somewhat hawkish on Iran, consulting American officials on how best to protect key infrastructure "when at war with Iran".
However, his focus on the risk of creating a new wave of domestic militants helped shape a Saudi policy on Syria that included more government aid to the opposition while discouraging private citizens from becoming donors or rebels.