As results poured in from polling stations around Malaysia on the night of May 9, with one parliamentary seat after another falling to the opposition, a stunned Prime Minister Najib Razak stared defeat in the face.
There was no hiding the fact: the Najib-led BN coalition that had run Malaysia for the six decades since its independence from Britain, had lost the election.
Voter anger over GST, as well as allegations of corruption that had swirled for years around Najib's government, and the apparently lavish lifestyle of his wife, had finally taken its toll.
A consultant who was in Najib's office as the reality of the defeat sank in said the prime minister was stunned. "When he knew that the numbers were not on his side, Najib broke down," he said.
Explaining Najib's shock on election night, one political strategist with ties to the now-defeated government said it was not unusual for him to be out of the loop when there were unwelcome developments.
"Najib lives in a bubble," he said. His advisers "don't accept others' views," he added. "They don't listen to bad news."
Najib's removal, and the disarray in his camp during the campaign and the election, was pieced together from interviews with about a dozen political operatives and members of the ruling coalition and the opposition.
Trump's favourite prime minister
The electoral defeat was a humiliating turn for Najib, who had ruled for almost a decade and had projected himself as a statesperson who enjoyed a warm relationship with Chinese President Xi Jinping, and played golf with US presidents.
Donald Trump showered him with praise during a White House visit last year, and according to local media once gave Najib a photograph of them together inscribed with the words: "To my favourite prime minister."
Dubbed 'The Survivor' on the cover of a magazine before the election, Najib, 64, had for three years weathered a scandal over the billions of dollars that went missing from the state fund 1Malaysia Development Berhad (1MDB). He consistently denied wrongdoing in connection with 1MDB.
Najib went into the poll confident of victory, according to the interviews with politicians and party officials. But his week went off-script quickly and – despite frantic efforts – he failed to pull it back.
Reuters was unable to reach Najib or any close aides for comment.
An official who worked on Najib's campaign said his camp had been sure of victory several days before the vote.
That confidence sagged as election day loomed with mounting evidence that momentum was with the opposition.
The political strategist said that two cabinet ministers were so unnerved that they stopped countrywide campaigning to concentrate on defending their own parliamentary seats.
Despite growing evidence of huge turnouts at opposition rallies, the ruling coalition remained confident of victory, even if with a weaker mandate, banking on its traditional Malay vote base.
Ten hours before polling stations opened, Najib went on national television and made voters a trio of promises.
If they returned him to power, he said, his government would scrap income tax for the young, declare two extra public holidays and make toll roads free for a few days during the Islamic festival of Eid.
"It was desperation," said the campaign official.
Opinion polls showed that voters were angry over living costs after the introduction of the GST, but they were also disgusted by the allegations of corruption surrounding Najib.
"It was conflated with so many other things - with higher costs of living, with inflation, with the goods and services tax," said Khairy Jamaluddin, the youth and sports minister in Najib's government, explaining the public discontent.
"But at the root of it was scandal."
A senior official in one of the opposition parties said that BN had been wrong to count on votes from the country's majority ethnic Malays on the basis of the affirmative-action policies that benefit them.
That shortcoming was underlined by the large crowds turning out for rallies for the opposition's Mahathir Mohamad, the 92-year-old former prime minister, in predominantly Malay areas that had long been bastions of support for the ruling coalition.
"Sometimes on the ground, we were telling ourselves this is too good to be true," said one leader of Mahathir's Pakatan Harapan.
On election day, opposition party officials said they were sure of victory by early evening thanks to results that their representatives at polling stations had passed on.
The mood was jubilant in the opposition camp as it became clear its candidates had beaten leading BN politicians and made significant gains across the country.
By midnight, Mahathir felt confident enough to declare victory.
Najib did not concede, however, apparently having recovered his composure as the night went on.
Khairy visited Najib at his house that night and said the prime minister was "calm" and "poised", but that the people around him were "stunned, shocked and sombre".
When the Election Commission eventually announced the result, hundreds of jubilant Mahathir supporters waved flags and cheered in central Kuala Lumpur.
The next day, Mahathir, who was once Najib's mentor and later his bitter adversary, was sworn in as prime minister.
Mahathir's challenges for the multi-ethnic nation are substantial: how to keep together an alliance made up of former foes, and implement populist measures and reforms without disrupting economic growth – even as he has promised to cede power to Anwar Ibrahim, the opposition leader jailed by Najib.
Mahathir's immediate attention appeared to focus on Najib.
During the election campaign, Mahathir had vowed to hold Najib to account for his alleged role in the disappearance of billions of dollars from a government fund.
As he assumed power last week, he said that those who had broken the law would be punished.
Meanwhile, Najib's estranged step-daughter, Azrene Ahmad, took to social media to hail "the end of an era of tyranny".
Anger at the airport
With Mahathir in power, speculation swirled about Najib's future. Would Mahathir have him arrested? Would Najib try to leave the country?
On the Saturday after the election, an angry crowd gathered outside a small airport near Kuala Lumpur. Online, another 30,000 people tuned into a Facebook live event, streaming from the airfield entrance.
A report had leaked that Najib and his wife, Rosmah Mansor, were going to try to leave Malaysia aboard a private plane.
"Stop them running away!" said one watcher of the Facebook Live event.
Amid the commotion at the airport, Najib announced on social media that he would indeed be leaving, to take a holiday overseas. But he and his wife never showed up at the airport.
What Najib hadn't realised then was that, just minutes before his announcement, the Immigration Department had issued a statement that Najib and Rosmah were barred from leaving the country – a final humiliation for the former prime minister.
Later that day, a sombre Najib appeared at a news conference that appeared to signal the end of his political career.
Struggling to get a microphone to work, he put on a brave face as he announced that he was resigning as leader of both his political party, Umno and BN.
"Anyone who is the leader and failed, it is the responsibility of that person to accept defeat. With an open heart, I accept it," he said.
Looking back at the evening of the election, Khairy, the BN lawmaker, discounted speculation that Najib had been hoping to find some way out of his predicament. Once the results had sunk in, Najib's priority had been figuring out how to achieve an orderly transition, he said.
"There were a lot of concerns that he was going to declare martial law, emergency rule, not hand over power," Khairy said. "Those were never ever options that were even discussed, thought or entertained in any way. It was just about accepting it and how we would concede."
Now, without Najib at the helm, the priority for the former ruling coalition was figuring out how to become the opposition for the first time, Khairy said.
"We were in a state of collective denial," he said, adding that the coalition had misunderstood the anger of the population. "We were too drunk on our own Kool-Aid, and this is a sobering lesson for us which we'll remember for the rest of our lives."
Unrestrained power in your hands
For almost 20 years, Malaysiakini has stayed true to the cause of providing the Malaysian public with the truth. We believe that with unadulterated information, the people will obtain power to make informed decisions.
Decisions which lead to a healthy, robust nation - ours!
Keep the truth alive. Support your robust, independent media. You have the unrestrained power to do so.
Who says it's not our fault?
We aren’t trained to take responsibility.
Everytime we observe an injustice - and choose to keep mum - the prevalence of injustice becomes our fault.
Astute journalism paves the way for the public to be continuously furnished with the fastidious truth. You are continuously empowered to act and to uphold the integrity of the nation.
The Rakyat owns Malaysiakini
We choose to take a risk on independent media because we believe that only through independent reporting can one be NOT beholden to the interest of businesses or organisations. This allows us to really pursue the truth - aggressively.
Independent for 20 years.
The victorious people
In the light of holding the truth to power, Malaysiakini will continue to uphold its mission of providing credible news to its discerning public. Your support for Malaysiakini is always treasured as a testament of innate nationalism. Your victory is our history.
Quietly. Effectively. Says it all. Malaysiakini.
Speaking truth to power
When we embarked on this journey 20 years ago, we knew we would face intimidation, harassment, raids, arrests and perhaps even jail terms. We got into this venture with our eyes wide open.
The main reason we have survived this long - when many others have folded - is partly because we are prudent in our finances. But while we may be tightfisted in our budgeting, we do not hold back when it comes to speaking truth to power and holding power to account. And certainly, this new administration will not stop us from continuing to do so.