Kenya's Supreme Court has unanimously upheld William Ruto's presidential win in a scathing judgement that blasted opposition leader Raila Odinga's accusations of cheating.
After Monday's judgement was handed down, Odinga tweeted that he would respect the ruling even though he disagreed with it, easing fears that Kenya would see any repeat of the violence that followed disputed votes in 2007 and 2017.
Several public figures and anti-corruption campaigners - including some who had backed Odinga - welcomed the judgement, saying it bolstered the court's reputation for independence.
"This decision is good for the judiciary. This election result is bad for Kenya. Two things can be true at the same time," tweeted author Nanjala Nyabola, who had not backed either candidate.
There were no immediate signs of protest in Odinga's stronghold of Kisumu city or the low-income neighbourhoods of Nairobi that traditionally support the left-wing politician.
"There is nothing we can do, the judgement has been made," Geoffrey Omondi, a 33-year-old electrical engineer who supported Odinga, said.
Ruto's jubilant supporters danced and waved flags in his party colours of yellow and green.
East Africa's most wealthy and influential nation had been on tenterhooks since the August 9 elections, which pitted Ruto - a former chicken seller - against two of nation's two most powerful political families.
Similar accusations of cheating triggered deadly election violence, often with ethnic undertones, during the two previous polls.
Chief Justice Martha Koome, who heads the seven-member Supreme Court, left no ambiguity about the court's position on key arguments brought by Odinga's team and other complainants.
She dismissed some affidavits alleging that polling stations results forms had been tampered with as "double hearsay" - and one as "no more than hot air ... a wild goose chase".
"Some of the (computer) logs presented as evidence ... were either from logs arising from the 2017 election or were outright forgeries," she said.
The history between Odinga, Ruto and outgoing President Uhuru Kenyatta underscores the tangled ties between elite families and the primacy of personality over politics.
Ruto was Kenyatta's vice president, but the two fell out and Kenyatta backed Odinga in the vote.
In a speech after the judgement, Ruto poked gentle fun at his predecessor and former ally, saying: "I've not yet spoken to my ... friend Uhuru Kenyatta."
Ripples of laughter spread through the audience before Ruto dissolved into uncontrollable chuckles at the podium.
Later he promised to respect both Kenyatta and Odinga, and said he would stop law enforcement mounting any politically-motivated corruption investigations - something he accused Kenyatta's government of doing.
Kenyatta is the son of the country's first president and Odinga the son of the first vice president.
Ruto, now a wealthy businessman, portrayed himself as an underdog battling the elite - a message resonating with chronically underemployed youth and families squeezed by global inflation and rampant graft.
Later in a speech posted on YouTube, Kenyatta said he would oversee a smooth transition to the next administration.
Ruto will be sworn in on September 13.