The appointment of Muhyiddin, who heads Mahathir's Bersatu party, will ironically bring back to power the United Malays National Organizationl, which was ousted by Mahathir's ruling alliance in 2018 elections.
Mahathir quit this week to object to Bersatu's plan to work with UMNO. Several UMNO leaders, including disgraced ex-Prime Minister Najib Razak, are on trial on corruption charges.
Mahathir struck a new deal early Saturday to work with his former ruling alliance led by rival Anwar Ibrahim to thwart Muhyiddin's plan but failed.
But the palace announced that King Sultan Abdullah Sultan Ahmad Shah believed that Muhyiddin has the support of a majority of lawmakers, and that he would be sworn in on Sunday.
Malaysian leader Mahathir Mohamad indicated Saturday that he will reconcile with the former ruling alliance he led with rival Anwar Ibrahim in an about-turn that follows a week of political turmoil that followed his resignation as prime minister.
Mahathir said he met with leaders from Anwar's Alliance of Hope early Saturday and is "now confident that I have the numbers needed to garner majority support" in Parliament to return as prime minister for a third time.
"I am therefore prepared to stand as prospective candidate for Prime Minister," said, Mahathir, the world's oldest leader at 94. The decision will be conveyed to the king, he added.
Mahathir didn't make clear in the statement if he was restoring the former alliance, which won a stunning victory in May 2018 elections. That victory ousted a ruling coalition, once led by Mahathir, that had governed Malaysia since independence in 1957 but had become entangled in a widespread corruption scandal.
The unlikely alliance between Mahathir and Anwar, longtime rivals, crumbled Monday after Mahathir's Bersatu party quit in a bid to form a new government with several opposition parties. Mahathir resigned in protest of the plan, which would have required him to work with the the governing alliance he ousted in the 2018 polls.
The Alliance of Hope initially nominated Anwar as the next prime minister but reversed Saturday to support Mahathir's candidacy. It condemned efforts to form a "backdoor government involving "kleptocrats and traitors."
"For the sake of defending the struggle, the Alliance of Hope expresses its full support for Mahathir Mohamad as prime minister," it said.
The move is believed aimed at countering plans by Bersatu to revive its bid to build an ethnic Malay-centric government after the party on Friday backed its president Muhyiddin Yassin, instead of Mahathir, to become prime minister.
Muhyiddin is seen as a more acceptable candidate as he was willing to work with the United Malays National Organization, where several leaders including ex-Prime Minister Najib Razak are on trial for corruption charges.
UMNO and its allies, including a fundamentalist Islamic party with strong rural support, have thrown their support behind Muhyiddin, putting him as a frontrunner in the battle for power. Much depends on two parties on Borneo island, that holds a bloc of votes.
"Never bet against the old horse. It's counter strike by Mahathir," said James Chin, who heads the Asia Institute at Australia's University of Tasmania. "If Muhyiddin brings back UMNO into the government, it will be a tragedy for Malaysia. He will be bringing back corruption, racism and Najib and the others may get off the hook."
Mahathir repeated Saturday that he is against any form of cooperation with UMNO but can accept individuals who leave the party. He rejected claims that he supported Muhyiddin's nomination.
Local media said the king will meet leaders of all political parties Saturday to let them nominate their prime minster candidate. Muhyiddin and leaders from his faction were the first seen at the palace.
Muhyiddin, 72, is a seasoned politician who was sacked by Najib as deputy prime minister in 2015 after he criticized Najib's handling of a massive graft scandal at the 1MDB state investment fund.
He helped Mahathir in 2016 from Bersatu, which later teamed up with Anwar's Alliance of Hope with a pact that Mahathir would eventually hand over power to Anwar. It is unclear if Mahathir will stick to that transition pact if he succeeds in another comeback.
After Mahathir resigned, the king dissolved the Cabinet and reappointed Mahathir as interim leader. The monarch then individually interviewed all 222 lawmakers but failed to establish a candidate with majority support.
Rather than holding a parliamentary vote to select a prime minister, the king normally appoints a nominated candidate if he is satisfied they have the majority of support.