What next?
Now that the election is over, a number of questions remain:
1. Who's prime minister?
Mahathir will be sworn in as Malaysia's new prime minister on Thursday evening.
But he is expected to fill the position for only a short time – two years at most, he has said – before handing the post over to opposition leader Anwar Ibrahim, who is serving jail time on what his supporters call trumped-up charges.
At a press conference on Thursday, Mahathir said the opposition would push for a royal pardon to allow Anwar – who is due to be released on June 8 – to return to politics.
A timeline however remains unclear.
In the meantime, Anwar's wife Wan Azizah Wan Ismail, another key opposition leader, is due to be Mahathir's deputy prime minister.
2. Can the opposition stay united?
While facing a common opponent – BN – Mahathir and PH had much in common. But once in power, it remains to be seen if they continue to agree on policy.
During his previous stint in office in 1981-2003, Mahathir was sometimes accused of authoritarianism. In what may have been a Freudian slip on Thursday, he called for a new prime minister to be sworn in immediately or else "the country will be without a ruler, umm, without a government."
The opposition already underwent a split in 2015 as widely divergent parties that had banded together for election purposes– including the Islamist PAS and the secular Democratic Action Party (DAP) – drifted apart.
Mahathir is also now representing a coalition whose de facto leader – Anwar Ibrahim – he sacked in 1998 as deputy prime minister. The two men remained bitter foes for 18 years before burying the hatchet with a much-publicized handshake in 2016.
3. What next for Malaysia?
The new government has its work cut out for it.
As voters and commentators rejoiced on Thursday that at last the people's voices had been heard, they also called for more checks and balances, an end to cronyism and corruption, increased transparency and accountability, a freer press and a fair democratic process in future elections.
"Now the hard work begins," an editorial by the political news website Malaysiakini said on Thursday, warning that it would take time to "to reverse the rot that had taken root for decades."
On the economic front, Malaysia has been enjoying strong growth, but analysts warned on Thursday that uncertainty from the change in government could spell volatility in the markets. Like most, they had banked on a win for BN and Najib.
Key opposition pledges, including abolishing the deeply unpopular goods and services tax (GST) and reintroducing fuel subsidies, could negatively impact the country's credit rating, Moody's Investor Service said.
Malaysia's shock election result already led to a drop in the national currency, the ringgit, on Thursday.
4. What happens to BN and Najib?
Such a momentous loss means Najib's days at the head of BN are numbered. But this may be the least of his worries.
The opposition vowed in its campaign manifesto to investigate the 1MDB scandal and this could spell trouble for the outgoing prime minister.
On Thursday, Mahathir insisted: "We are not seeking revenge, we don't want to punish people."
However, voters' anger over the scandal will make it hard for the new government to go back on its campaign pledges.
By Sim Sim Wissgott