Kenya's Deputy President William Ruto has defied the odds by winning the fiercely contested presidential election in East Africa's powerhouse.
His victory was narrow, stunning, and highly controversial as four of the seven members of the electoral commission rejected the result amid claims of rigging.
There were chaotic scenes inside the main tallying centre. Scuffles broke out around the podium as the head of the commission, Wafula Chebukati, was seemingly about to announce the results.
Mr Chebukati later returned to declare Mr Ruto the winner, and insisted that the election was free and fair.
The official results show that Mr Ruto gained ground in the strongholds of Raila Odinga, his main opponent. He also won by a landslide in Mount Kenya - the political heartland of Mr Odinga's running-mate Martha Karua and the outgoing President Uhuru Kenyatta.
This helped swing the election in Mr Ruto's favour.
He was the underdog or, as he preferred to call himself, the "hustler", fighting what he saw as an attempt by two of Kenya's biggest political dynasties - the Odingas and Kenyattas - to hang on to power. This narrative struck a chord with many young Kenyans.
The 55 year old trailed in opinion polls, and faced a formidable opponent - Mr Odinga - who, in an extraordinary development, was backed by his long-time rival, President Kenyatta.
The president will now have to swallow his pride and hand over the reins of power to his deputy - a man he labelled during the campaign as "untrustworthy".
All this is conditional on the result being genuine - and not rigged as Mr Odinga's supporters allege.
Their position has been bolstered by the majority of election commissioners saying they cannot take "ownership" of the result, but Mr Chebukati was adamant that it reflected the will of Kenyans.
"I stand before you despite intimidation and harassment. I have done my duty according to the laws of the land," Mr Chebukati said.
There is no doubt that Mr Ruto's narrow margin of victory - and the split within the commission - shows that the nation is divided.
How Mr Ruto constitutes his government will determine whether the country will be reunited.
With ethnicity a major factor in Kenyan politics, Mr Ruto will have to ensure his government is representative of Kenya's main ethnic groups - especially the Luo community of Mr Odinga.
A Luo has never occupied the presidency in Kenya's history, and the community is bound to feel marginalised and aggrieved following the declaration that Mr Ruto - who comes from the Kalenjin ethnic group - had won.
Mr Ruto was magnanimous in his victory speech, saying he would work with "all leaders" and would strive to ensure the nation was "united and prosperous".
He said he had reached out to Mr Odinga before the announcement and they agreed that whatever the outcome, they should have a conversation.
Mr Odinga has not yet spoken, but he stayed away from the official announcement of the result.
It is not yet clear whether he will challenge the result in court, as he has done in the past.
He has lost four previous elections. This was seen as his best chance of winning as Mr Kenyatta campaigned heavily for him, urging voters not to cast their ballots for Mr Ruto.
Mr Kenyatta conceded during the campaign that he had broken a pact to back Mr Ruto in this election. He justified it by comparing his deputy to a co-driver who threw things out of a vehicle while the driver was busy steering it.
As far as Mr Ruto is concerned, Mr Kenyatta campaigned for Mr Odinga because he wanted a "puppet president".
Aged 77, it is unclear whether Mr Odinga will run for the presidency for a sixth time in the next election in 2027.
Mr Ruto, one of the country's biggest maize farmers, has won at his first stab at the presidency - and will be Kenya's second-youngest president after President Kenyatta won in 2013 aged 50.
He is a powerful orator - becoming involved in politics two decades ago in the youth wing of the then-ruling party - and drew huge crowds during the campaign.
He has managed to eat into Mr Odinga's strongholds in the coastal, western and north-eastern parts of the country.
His victory is all the more remarkable as he won by a landslide in Mr Kenyatta's backyard of Mount Kenya, the heartland of the Kikuyu people who are the largest voting bloc in Kenya.
Mr Ruto's party also took a huge majority of seats in the region in elections for parliament, the senate and the governor's post, ousting Mr Kenyatta's Jubilee party.
In the presidential vote, he even trounced Mr Odinga in the constituencies of both Ms Karua and Mr Kenyatta.
Supporters of Mr Ruto in Mount Kenya who spoke to the BBC before the elections said they felt the need to honour the 2013 pact to pay back his backing for their son Mr Kenyatta.
It is a humiliating setback for Mr Kenyatta, who now leaves office with his reputation tarnished among his own Kikuyu people.
His own cousin, who chairs an association of elders, said they would back Mr Ruto.
The win will be lauded by many young people, who formed the majority of his support-base.
Mr Ruto coined the phrase "Hustler Nation" to refer to the young people struggling to make ends meet, and promised a "bottom-up approach" to the economy, saying it will benefit the poor.
He will now have to deliver on his promise.
It will be a difficult task as the official rate of unemployment among those aged between 18 and 34 years is nearly 40%, and the economy is not creating enough jobs to absorb the 800,000 young people joining the workforce every year.
WILLIAM RUTO: A profile of Kenya's next president
RUTO HEARTLAND: Why Kenyan farmers like a man with big ambitions
UHURU KENYATTA: How Kenya's president divided his people
CONTEXT: Seven charts that explain Kenya
READ MORE: Full coverage