Malaysian Prime Minister Mahathir Mohamad resigned on Monday in a shock move after his political allies sought to bring down the government and block the succession of leader-in-waiting Anwar Ibrahim.
It came after months of rising tensions in the "Pact of Hope" coalition, which stormed to a shock victory in 2018 against a corruption-plagued government that had ruled Malaysia for six decades.
But there were calls for Mahathir, the world's oldest leader at 94, to stay in office from allies who insisted he had not backed the formation of a new government and had quit in disgust at the plot.
The political drama began on Sunday when Anwar's rivals from the ruling coalition and opposition politicians held a series of meetings around Kuala Lumpur, stoking speculation a new alliance was taking shape.
That coalition would reportedly have excluded Anwar, Mahathir's presumptive successor and a former opposition icon who was jailed for years on questionable sodomy charges, blocking his ascent to the premiership.
With the fate of the government still uncertain Monday, Mahathir submitted his resignation to the king. The monarch accepted it, but appointed him interim leader until a new premier is found, according to an official statement.
Anwar - who has famously stormy relationship with Mahathir - said the premier assured him "he played no part" in attempts to form a new government, and was "very clear that in no way will he ever work with those associated with the past regime".
The proposed new coalition was reportedly set to include the United Malays National Organisation (UMNO) -- the party of disgraced ex-leader Najib Razak, which was ejected from office two years ago.
Anwar and Mahathir put their differences aside and joined forces to take on a corruption-plagued government at the 2018 polls. Mahathir, who previously served as premier from 1981 to 2003, had made a pre-election pledge to hand power to Anwar but has repeatedly refused to fix a date.
Shortly before his resignation, Mahathir's Bersatu party quit the ruling coalition and several lawmakers resigned from Anwar's party, leaving the Pact of Hope in tatters and fuelling suggestions efforts could be underway to form a new alliance.
Mahathir also quit as Bersatu chairman.
There was initially speculation Mahathir was behind the drive to form a new government, but Anwar and other allies quickly denied that.
Finance Minister Lim Guan Eng - a senior member of the Democratic Action Party, which formed part of the "Pact of Hope" - said that Mahathir had resigned in protest at the "nefarious attempt" to topple the government.
"Mahathir clearly stated that he cannot work with UMNO when we worked so hard to reject UMNO successfully in the 2018 general elections," he said, adding his party would nominate Mahathir to continue as prime minister.
Ibrahim Suffian, who heads independent polling firm Merdeka Centre, said Mahathir could come back as premier and the crisis may work in his favour.
"It gives him an opportunity to reshape the ruling coalition," he told AFP.
The final outcome of the drama was far from clear, however, and analysts said a snap poll could be called.
Anwar had teamed up with former nemesis Mahathir to oust the government of Najib, who had become embroiled in the massive 1MDB graft scandal.
The pair's difficult relationship has dominated Malaysia's political landscape for over two decades.
Anwar was sacked from government in the 1990s by Mahathir and then convicted of corruption and sodomy, in what his critics said was a politically motivated case, and they only reconciled before the election two years ago.
The Pact of Hope had always seemed an uneasy alliance and their popularity had been falling, as they were accused by critics of failing to look after the country's ethnic Malay Muslim majority and push forward reforms.
Race and protection of Malay rights are highly sensitive in Malaysia, which is about 60 percent Muslim but also home to substantial ethnic Chinese and Indian minorities.