Malaysia's Muhyiddin Yassin, a Malay nationalist politician backed by the corruption-tarnished former ruling party, was sworn in as prime minister on Sunday after the king picked him to replace 94-year-old Mahathir Mohamad.
The swearing-in capped a week of turmoil that began with Mahathir's resignation in an apparent bid to consolidate power, but ended with him sidelined and complaining of betrayal after decades dominating Malaysian politics.
Mahathir promised to seek a vote in parliament to challenge Muhyiddin's support, but conceded he might not win.
Muhyiddin, 72, was sworn in at a palace ceremony in front of Malaysia's king, Sultan Abdullah Sultan Ahmad Shah, and promised to fulfil his duties as prime minister.
The change in leadership comes less than two years after Mahathir joined old rival Anwar Ibrahim, 72, to defeat the ruling party of six decades, the United Malays National Organisation (UMNO), on an anti-corruption platform.
"This is a very strange thing," said Mahathir. "This is the losers that will form the government," he added, referring to the outcome of the 2018 election.
He said he had the support of 114 of parliament's 222 members, but it was not guaranteed that they would all support him at a vote in a country of tangled political interests where horse-trading is commonplace.
Mathathir questioned whether a government involving the former ruling party would be as ready to pursue graft cases against its politicians. Those include former prime minister Najib Razak, who is now on trial for corruption.
A week of twists and turns in Malaysian politics began with Mahathir's resignation, breaking his alliance with Anwar as he proposed a national unity government without party loyalties that would have given him greater authority.
But Anwar then launched his own bid to become prime minister while Muhyiddin built his alliance.
It was down to the king to decide who would have the best chance to form a government. Although Mahathir and Anwar said they had reunited on Saturday and now had majority support, the king announced Muhyiddin as the candidate.
About 200 protesters gathered in Kuala Lumpur late on Saturday to protest against the king's decision. Police said they were investigating a Twitter post that encouraged people to join the protest, which they said was illegal.
Muhyiddin is from Mahathir's Bersatu party, but had shown himself ready to work with UMNO - from which he had been sacked in 2016 after questioning former prime minister Najib's handling of the 1MDB corruption scandal.
UMNO's fortunes have risen since its 2018 defeat, with the Pakatan coalition of Mahathir and Anwar losing five by-elections in the face of criticism from some Malay voters that it could do more to favor the biggest ethnic group in a nation of 32 million.
UMNO, which Mahathir led from 1981 to 2003 during a previous stint as prime minister, supports Malay nationalism.
"I think Muhyiddin would lead a more overtly pro-ethnic Malay government characterized by social division, economic nationalism, and possibly less fiscal restraint," said Peter Mumford of the Eurasia consultancy.
As well as personal relationships, politics in Malaysia is shaped by ethnic, religious and regional interests. Malaysia is more than half ethnic Malay, but has large ethnic Chinese, Indian and other minorities.