Malaysia's political crisis deepened Saturday after 94-year-old Mahathir Mohamad rejected a decision by the king to pick his rival as the next prime minister, insisting he had enough backing to return to the role.

Ex-interior minister Muhyiddin Yassin was earlier named for the job by the monarch, who appoints the country's premiers after deciding who has backing from MPs, signalling a defeat for Mahathir and the return of a scandal-plagued party to power.

It capped a week of turmoil that began when Mahathir's "Pact of Hope" alliance collapsed and he resigned as prime minister following a bid by his rivals to form a new government and push out leader-in-waiting Anwar Ibrahim.

Their alliance stormed to a historic victory in 2018 that broke the six-decade stranglehold on power of a corruption-riddled coalition, but it was riven by infighting over who should succeed the world's oldest leader.

Malaysia's Mahathir Mohamad has lost a power struggle to a little-known ex-interior minister, ending his premiership
Malaysia's Mahathir Mohamad has lost a power struggle to a little-known ex-interior minister, ending his premiership AFP / Mohd RASFAN

The victory of Muhyiddin and his coalition, which is dominated by the country's ethnic Malay Muslim majority, was a shock as Mahathir had appeared to be in the lead, and it sparked widespread public anger.

Not only does the win remove a democratically elected government but it also signals the return to power of the United Malays National Organisation (UMNO), the scandal-plagued party of disgraced ex-leader Najib Razak.

UMNO was the lynchpin of a long-ruling coalition toppled from power at historic elections two years ago amid allegations Najib and his cronies looted state fund 1MDB. Najib is now on trial for corruption.

The coalition also includes a hardline Muslim party pushing for tougher Islamic laws in Malaysia.

Former interior minister Muhyiddin Yassin (C) is set to become Malaysia's prime minister in a shock twist to a week of political chaos
Former interior minister Muhyiddin Yassin (C) is set to become Malaysia's prime minister in a shock twist to a week of political chaos AFP / Mohd RASFAN

Addressing supporters outside his Kuala Lumpur house, Muhyiddin said: "I urge all Malaysians to take the decision that has been made by the palace today well."

The palace earlier said the king believed Muhyiddin had enough support and he would be sworn in Sunday.

Anwar Ibrahim's hopes of becoming prime minister have been dashed by the surprise move
Anwar Ibrahim's hopes of becoming prime minister have been dashed by the surprise move AFP / Mohd RASFAN

But after meeting his political allies, Mahathir said he had received the backing of 114 MPs to be prime minister -- above the required number of 112 -- and released a statement listing their names.

Mahathir said he would send a letter to the king explaining this, and added the number of MPs that Muhyiddin claimed to have supporting him was "not accurate".

Anger was growing at the surprise decision to name Muhyiddin premier and allow UMNO back into power. The hashtag NotMyPM was trending on Twitter, and a small group of protesters gathered in downtown Kuala Lumpur.

"These are not the people we voted for," one protester, who only gave her surname Soon, told AFP, as chants of "long live the people, rise up" rang out.

"These are not the people who were given the democratic mandate two years ago."

The political crisis began when a group of ruling coalition lawmakers joined forces with opposition parties in a bid to form a new government without Anwar and stop him becoming premier.

After the government fell, Mahathir was appointed interim premier and he and Anwar initially launched separate bids for power, reviving their old rivalry.

But as Muhyiddin's bid quickly gained support and it became clear that he could get into power with UMNO, Mahathir and Anwar did a volte-face and joined forces again on Saturday.

A growing number of their allies threw their support behind Mahathir to become premier -- but it was too little, too late.

The "Pact of Hope", a ragtag band of opposition groups, was uneasy from the start. It saw its popularity fall rapidly as it faced criticism it was not doing enough to protect Muslims' rights, and it lost a string of local elections.

Muhyiddin, 72, was a member of UMNO for many decades and held a string of senior posts. He was deputy prime minister in Najib's government, but Najib sacked him after he voiced criticism of the 1MDB scandal.

He is seen as a Malay nationalist and once sparked anger by saying he was "Malay first" and Malaysian second -- a controversial remark in the country of 32 million which is also home to substantial ethnic Chinese and Indian minorities.