Malaysia's opposition and its 92-year-old autocrat-turned-reformer prevailed in Wednesday's election, upsetting the coalition that has ruled the country for the last six decades.
Pakatan Harapan, or Alliance of Hope, won 113 seats in the country's parliament — one more than needed to form a government and dislodge Prime Minister Najib Razak, who has been in office since 2009 and whose Barisan Nasional, or National Front, has held power since the country gained independence from Britain in 1957.
By 10 p.m. Wednesday, thousands of opposition supporters had poured into the streets of the capital, Kuala Lumpur, and other cities in anticipation of a formal announcement of victory.
"We have in fact achieved a substantial majority," Mahathir Mohamad, the former prime minister who became a front man for the opposition, said at a news conference at 2:30 a.m. Thursday. "I hope tomorrow we will have a swearing in of the prime minister."
That would be Mahathir — 15 years after his retirement. During his 22 years in office, he oversaw Malaysia's economic modernization but used draconian laws to lock up opponents and critics. Out of office, he became a behind-the-scenes kingmaker within the ruling coalition.
But he turned against the National Front in 2015 after newspaper reports alleged that Najib stole $700 million in public money. Najib, who was never charged with a crime, said the money was a Saudi Arabian donation and that he had returned most of it.
In opposition protests against Najib in 2016, Mahathir appeared in front of thousands of his former enemies to join their cause.
With the main opposition leader, Anwar Ibrahim, jailed on charges of sodomy with a former employee, Mahathir was recruited to lead the opposition's election campaign.
Anwar is scheduled to be released from prison on June 8 — and sometime after that, Mahathir is expected to offer a pardon, help him win a seat in parliament and hand over power.
The two men have a complicated history. Anwar served as Mahathir's deputy prime minister in the 1990s before rebelling and leading the protests that accompanied the 1997-98 Asian financial crisis. Then Mahathir had Anwar jailed for six years.
Chinese Malaysians, a relatively well-off minority making up about a quarter of the population, and others who opposed Mahathir's often authoritarian rule were taken aback at first by the return of the 92-year-old to lead the opposition.
But making Mahathir the frontman was, in part, a calculated move to draw Muslim Malays, who make up 60% of the population, away from his former political allies. It appears to have worked.
Though the majority of Malaysians live in cities, rural areas also played a big role in the election, because smaller, less-populated constituencies could elect the same number of MPs as more populated urban areas.
The opposition had alleged that this system was designed to favor the National Front, which had narrowly prevailed in the 2013 election despite losing the popular vote by 4%.
The unusual midweek vote, which made it difficult for Malaysians working in cities such as Kuala Lumpur and in neighboring Singapore to travel to their home towns to vote, was also expected to reduce the turnout from a 2013 high of 85% and make it more difficult for the opposition to win.
But voting went smoothly despite long lines and soaring temperatures and humidity. K.T. Lim, a 56-year-old businessman, said he arrived at the polling station in Kuala Lumpur at 7:45 a.m. — 15 minutes before opening — and waited more than three hours to vote.
"It is no big deal," he said.
"Corruption, corruption," he said, explaining his vote for the opposition.
Before the result was officially announced, Khairy Jamaluddin, a popular young politician and ally of the current prime minister, appeared to accept that there would be a change in government.