Supporters waved flags and cheered outside the Istana Negara palace in the capital, Kuala Lumpur, as Dr Mahathir, who previously served as prime minister for 22 years, took the oath once again.
The ceremony took place at 9.30pm after a day of political drama that began in the early hours with Dr Mahathir’s opposition coalition trouncing Najib Razak, the incumbent prime minister, and his ruling Barisan Nasional coalition (BN), in a shock election victory.
Mr Najib waited until mid-morning to grudgingly accept defeat, but he immediately cast doubt on his former mentor’s right to be appointed prime minister, declaring that only the king, as head of state, had the authority to make that choice.
Hours of unexplained delays in Dr Mahathir’s appointment heightened fears that the transition of power, after ousting a coalition that had ruled Malaysia for over sixty years, would not be smooth.
The former political strongman urged Yang di-Pertuan Agong, the country’s monarch, to allow him to form a government by 5pm, warning that any delay would mean you “have no government, you have no law, you have no constitution.”
Despite lingering uncertainty about his appointment, Dr Mahathir turned up at the palace shortly before 5pm in a black limousine, accompanied by his wife, Dr Siti Hasmah Ali.
The palace was later forced to issue a statement to “strongly refute” any allegation that the king had delayed Dr Mahathir’s transition to power.
“His Majesty the King strongly supports and respects the democratic process and the wishes of his subjects,” read the statement, adding that the monarch looked forward to working with the new government “for the betterment of our nation and all its people.”
Najib Razak, the incumbent prime minister, had been widely expected to lose the popular vote but to win the most number of seats in parliament in a first-past-the-post system that opponents claimed was weighted in favour of his ruling BN coalition.
Instead the election result went down to the wire after a formidable challenge by Dr Mahathir, who pulled himself out of retirement to fight a prime minister he claimed was tainted by a multibillion dollar graft scandal.
Official results from the Election Commission showed that Mahathir’s opposition grouping Pakatan Harapan, along with a small ally, had secured 121 parliamentary seats. 112 are needed to form a government.
The elections were dominated by an investigation into allegations that billions were siphoned from a state investment fund, 1MDB, and laundered through foreign bank accounts. But the prime minister has consistently denied any wrongdoing and has been cleared of any offence by Malaysia’s attorney general.
Mr Anwar is currently serving time in jail after being convicted of sodomy, in a case his opposition party claim was created to curb their rise in popularity. He will be released in June.
Mr Najib said he accepted the will of the people.
“I accept the verdict of the people,” the leader, who looked shattered after his coalition’s defeat, said.
But his failure to make a clear concession, prompted analysts to warn he could be trying to buy time to win defections from other parties over to his Barisan Nasional (BN) coalition, in what would be a desperate bid to cling to power despite a landslide defeat.
Despite the shock result there were no reports of trouble on the streets, where pockets of celebration erupted overnight.
A flag-waving crowd of supporters gathered on a field outside the headquarters of Mahathir’s party near Kuala Lumpur.
Suva Selvan, a 48-year-old doctor, said he felt the country had just won its independence.
“I feel that with this change we probably can see something better in the future… our hope for the future is a better government, fair, free and united,” he told AFP.
Dr Mahathir raised the suspicion of foul play by the election commission for being slow to declare the results as he claimed the victory before official results were announced.
“The likelihood is that they (Barison Nasional) would not be forming the government,” he told a press conference. “We believe certain meetings are being held. And we worry what’s the intention of these meetings.”
He added: “We hope and pray that the people respect law and order. This is very serious.”
Dr Mahathir alleged that the election commission was “holding back the results” and not doing their duty. “The time is very late now. By now we would know who’s wining or losing. But there’s a deliberate attempt to delay by not signing the form,” he said.