Malaysia's king has appointed seasoned politician Muhyiddin Yassin as the new prime minister, the latest twist to a weeklong political crisis.

In a statement issued by the palace on Saturday, Sultan Abdullah Sultan Ahmad Shah said Muhyiddin, a former interior minister and president of the Bersatu party, will be sworn in on Sunday as he likely commands the most support of any candidate.

More:

The appointment came after this week's shock resignation of Prime Minister Mahathir Mohamad, a move that plunged the country into crisis following a weekend of political wrangling and the collapse of the ruling alliance.

"The process to appoint the prime minister cannot be delayed because the country needs a government for the wellbeing of the people and the nation," the palace statement said. The king appoints the country's prime minister.

The king decreed that "it was the best decision for all".

The announcement came hours after Mahathir struck a new deal to work with his former ruling alliance led by rival Anwar Ibrahim and threw his name into the fray again.

But the palace announced that King Abdullah believed that Muhyiddin has the support of a majority of legislators.

"I only ask for all Malaysians to accept the decision announced by the national palace today," Muhyiddin told reporters at his home.

'Real challenge'

Mahathir, 94, had led the Alliance of Hope (Pakatan Harapan, or PH) to a spectacular election win in 2018 but the government imploded on Monday when he unexpectedly quit.

Muhyiddin had emerged on Friday as the frontrunner after receiving more backing from legislators than PH's Anwar Ibrahim, a longtime rival and sometime ally of Mahathir.

The appointment of Muhyiddin, who heads Mahathir's Bersatu party, will ironically bring back to power the United Malays National Organization, which was overthrown by Mahathir's governing alliance in a historic vote in May 2018.

"A lot of people in Malaysia are very upset," said Bridget Walsh, a senior researcher at the National Taiwan University.

"(Muhyiddin is) the man without the mandate. He faces a real challenge to get support and move the country forward," she told Al Jazeera.

"He has not offered plans (for government) and his own coalition is also very large. There will be challenges to keeping it together."

Amy, a Malaysian voter from Kuala Lumpur, said while she likes Mahathir and supported him during the 2018 elections, she welcomes the election of Muhyiddin.

"He should be given a chance," she told Al Jazeera.

Additional reporting by Ted Regencia from Kuala Lumpur