Malaysia faced a hung parliament Sunday, after neither of the two major alliances of parties competing in the previous day's general election was able to win a majority, while former Prime Minister Mahathir Mohamad lost his parliamentary seat.

The palace, in a statement, directed the competing coalitions to inform the monarch by 2 p.m. Monday of their agreed-on alliances that have majority control of the parliament and a prime minister of their choice.

Opposition leader Anwar Ibrahim (C) celebrates at a hotel in a Kuala Lumpur suburb on Nov. 20, 2022, after Malaysia's general election on the previous day. (Kyodo)

The defeat of Mahathir, who was the chief architect of the country's transition into a modern economy and one of Asia's best-known politicians, will likely signal his exit from the political stage. The 97-year-old ruled Malaysia from 1981 to 2003 and then again in 2018-2020 during two stints in power.

Mahathir, who got less than 10 percent of the vote in the constituency he was contesting, was head of a grouping of Malay parties. His electoral loss was his first since 1969.

The election took place amid political instability in the country, which has seen three leadership changes in the past four years.

The multiethnic Pakatan Harapan, or Alliance of Hope, a group led by Anwar Ibrahim, opposition leader and former deputy prime minister, gained 82 of the 220 lower seats contested, according to local media.

Perikatan Nasional, or National Alliance, led by former Prime Minister Muhyiddin Yassin, trailed in second with 73 seats while Prime Minister Ismail Sabri Yaakob's ruling Barisan Nasional, or National Front, coalition, hit by corruption scandals, won 30 seats.

The PH is multiethnic and popular among voters in cities, while the PN has strong support among ethnic Malays in rural areas.

Both Anwar Ibrahim and Muhyiddin claimed Sunday their alliances will be able to find the numbers to form a new government.

The contests for two of the lower chamber's 222 seats were postponed due to the death of a candidate and bad weather. A total of 116 seats in three state assemblies were also at stake.

In the 2018 election, the PH toppled the BN government, which had been in power since independence. But the BN, now led by Ismail Sabri's United Malays National Organization, returned to power in 2020 after the PH government under Mahathir collapsed due to political defections.

Mahathir, Malaysia's longest-serving prime minister, was known for launching his "Look East Policy" during his first stint in power in which he took postwar Japan as a development model.

Ahead of Saturday's election, UMNO had hoped that electoral gains in recent state contests would see it improve on its performance in the 2018 election in which it fell from power.

Related coverage:

Malaysians vote in general election amid political instability