Malaysian Prime Minister Mahathir Mohamad submitted his resignation to the king after a bid by his political partners to bring down the government.

Malaysian Prime Minister Mahathir Mohamad tendered his resignation to Malaysia’s king Monday while his political party quit the ruling alliance in a shocking political upheaval less than two years after his election victory.

The prime minister’s office said in a brief statement that Mahathir submitted his resignation to the palace at 1 p.m. but gave no further details.

The stunning turn of events come amid plans by Mahathir supporters to team with opposition parties to form a new government and thwart the transition of power to his named successor Anwar Ibrahim.

Minutes before his resignation was offered, Mahathir’s Bersatu party announced it would leave the alliance and support Mahathir as the premier. Eleven other lawmakers, including several Cabinet ministers, also announced they are quitting Anwar’s party.