Image copyright Reuters Image caption Muhyiddin Yassin was sworn in as prime minister on Sunday

Malaysia has a new prime minister, less than a week after the unexpected resignation of Mahathir Mohamad plunged its politics into turmoil.

Muhyiddin Yassin, backed by the corruption-tarnished former governing party, was sworn in by the king.

Mr Mahathir, 94, who has dominated Malaysian politics for decades, described the appointment of Mr Muhyiddin as illegal and a betrayal.

He vowed to seek a vote in parliament to challenge Mr Muhyiddin's support.

Mr Mahathir, who was the world's oldest elected leader, had returned to power in 2018 in a coalition with his old rival Anwar Ibrahim.

In a surprise victory, he ousted then-prime minister Najib Razak, who is on trial charged with taking millions of dollars from a government wealth fund.

Mr Mahathir threw the country's politics into turmoil last weekend when he resigned, breaking his alliance with Mr Anwar.

But the move backfired, as Mr Anwar initially decided to run for prime minister while Mr Muhyiddin built his alliance.

"This is a very strange thing... Losers will form the government - the winners will be in the opposition," Mr Mahathir said, referring to the outcome of the 2018 election.

Malaysia faces unprecedented uncertainty

Jonathan Head, BBC News

This level of political uncertainty is without precedent in Malaysia, where one party, UMNO, ruled for more than 60 years, until its defeat in the election two years ago on a wave of public anger over corruption and abuses of power.

Mr Muhyiddin defected from Mr Mahathir's coalition a week ago, and has allied himself with his old party, UMNO.

Many Malaysians fear the new government will rely heavily on ethnic Malay support, and marginalise minorities.

There are also fears it will row back on the corruption investigations into UMNO leaders, thought to have cost Malaysia many billions of dollars over the past decade.

Mr Mahathir was prime minister from 1981 to 2003. Mr Anwar was his deputy but the relationship soured when Mr Anwar was sacked in 1998 after a leadership dispute.

Mr Anwar was later jailed on corruption and sodomy charges, which were widely regarded as politically motivated.

But in 2018, Mr Mahathir shocked the country when he announced that he was teaming up with Mr Anwar. He said he was doing so to oust the government of Mr Najib, who had become embroiled in the 1MDB corruption scandal.

Mr Mahathir and Mr Anwar's alliance won - and Mr Mahathir agreed to eventually hand power over to his partner.

But Mr Mahathir repeatedly refused to say when he would transfer power - stoking tensions within the opposition alliance.

Media playback is unsupported on your device Media caption Malaysian voters react in 2018 to Mahathir Mohamad's victory over Najib Razak

After Mr Mahathir's resignation last weekend, he and Mr Anwar then announced on Saturday that they had, in fact, reunited again and commanded majority support.

But the king, Sultan Abdullah Sultan Ahmad Shah, who had ultimate say on who should form a government, chose Mr Muhyiddin.

A former interior minister, Mr Muhyiddin once controversially described himself as "Malay first" and Malaysian second.