KUALA LUMPUR: Malaysia's Anwar Ibrahim is expected to start discussions on forming his cabinet on Friday as he begins work as prime minister at a challenging time, with the economy slowing and the country deeply split after a close election.

Anwar, 75, was sworn in as premier on Thursday, capping a three-decade political journey from a protege of veteran leader Mahathir Mohamad to protest leader, a prisoner convicted of sodomy and opposition figurehead.

Anwar, who was appointed by Malaysia's king following an inconclusive election, said that the people of Malaysia had long been awaiting change.

"We will never compromise on good governance, the anti-corruption drive, judicial independence and the welfare of ordinary Malaysians," he said late on Thursday.

Anwar's appointment ends five days of unprecedented post-election crisis but could usher in further instability with his rival, former prime minister Muhyiddin Yassin, challenging him to prove his majority in parliament.

Both men's coalitions failed to win a majority in Saturday's election, but Malaysia's constitutional monarch, King Al-Sultan Abdullah, appointed Anwar after speaking to several lawmakers.

The campaign pitted Anwar's progressive, multi-ethnic coalition against Muhyiddin's mostly conservative ethnic-Malay, Muslim alliance.

Anwar had previously been denied the premiership despite getting within striking distance over the years. In between, he spent nearly a decade in jail for sodomy and corruption in what he says were politically motivated charges.

The uncertainty over the election had threatened to exacerbate instability in Malaysia, which has had three prime ministers in as many years, and also risked delaying policy decisions needed to foster economic recovery.

"Anwar’s tasks have just started, to unite a very polarised and divided nation, based on race and religion," said former lawmaker and coalition ally Lim Kit Siang.

Markets surged on Thursday on the end of political deadlock, but investors will be monitoring how Anwar manages the aftermath of the election.

Malaysian stocks on Friday morning were .KLSE flat, after 4% gains the previous day, while the ringgit MYR= extended gains, up nearly 1%.

ALLIANCE OF SUPPORT

Anwar's supporters expressed hope that his government would avert a return to historic tensions between the ethnic Malay, Muslim majority and ethnic Chinese and Indian minorities.

Anwar's coalition, known as Pakatan Harapan, won the most seats in Saturday's vote with 82, while Muhyiddin's Perikatan Nasional bloc won 73. They needed 112 - a simple majority - to form a government.

The long-ruling Barisan bloc won only 30 seats - the worst electoral performance for a coalition that had dominated politics since independence in 1957.

Anwar said Barisan and an alliance of parties from Malaysian Borneo had pledged support, giving him a convincing majority. He indicated that there would be two deputy prime ministers - one from each of the blocs.

Muhyiddin's bloc includes the Islamist party PAS, whose electoral gains raised concern within the ethnic Chinese and Indian communities, most of whose members follow other faiths.

Authorities have warned of a rise in ethnic tension since the vote on social media and short video platform TikTok said this week was on high alert for content that violated its guidelines.

The most immediate issue facing Anwar beyond picking a cabinet will be the budget for next year, which was proposed before the election was called but has yet to be passed.

Anwar said he would convene parliament on Dec. 19 for a vote of confidence to prove his majority in the lower house.