NAIROBI, Kenya — The Supreme Court of Kenya on Monday upheld the election of William Ruto as president, ending a courtroom battle over disputed results from the Aug. 9 election and confirming him as the fifth president of a country often seen as an indicator of democratic strength in Africa.
The court presented a unanimous, sweeping rejection of the arguments by Mr. Ruto’s rival, Raila Odinga, describing them variously as “sensationalism,” “hearsay,” and “a wild-goose chase that yielded nothing of value.” Its verdict means that Mr. Ruto, the charismatic and populist vice president, could be inaugurated as early as Sept. 13.
The decision marked another stinging defeat for his rival, Mr. Odinga, 77, who was making his fifth bid for the presidency, having lost the first four. The election had been hard fought: Mr. Ruto, who pitched his campaign at Kenya’s “hustlers,” or young strivers, won narrowly, getting 50.5 percent of the vote to Mr. Odinga’s 48.9 percent.
In its ruling, the court rejected the arguments made by Mr. Odinga’s lawyers and other petitioners last week that the chairman of Kenya’s election commission had swung the vote in favor of Mr. Ruto, acting in concert with foreign agents who had hacked into the commission’s computer system.
Chief Justice Martha Koome, reading the judgment on behalf of the court’s seven members, said it had found “no credible evidence” that the electoral computer system had been interfered with or hacked, or that the technology employed by the commission failed to meet standards of integrity.
Some of the accusations presented by Mr. Odinga’s lawyers were based on “sensational information” or amounted to “no more than hot air,” she said.
Contradicting a key tenet of Mr. Odinga’s case, she said that there were “no significant differences” between the paper tallies submitted at 46,229 polling stations and the electronic versions that were uploaded online to a publicly available portal.
There was no immediate reaction from Mr. Odinga but his running mate, Martha Karua, who made some of the strongest accusations of rigging in recent weeks, tweeted: “The court has spoken. I respect but disagree with the findings.”
The ruling put the courts yet again at the center of Kenya’s hard-fought elections, where dueling forces rarely accept the results and occasionally point to electoral malpractice. Contested elections in 2007 and 2017 prompted violence that, combined, left over 1,200 dead and 600,000 displaced.
The judgment on Monday was delivered to a courtroom packed with lawyers in the capital, Nairobi, less than a month after the end of a fiercely fought electoral battle that was closely followed across Africa and the world. The police closed several roads leading to the court and dozens of security officers were placed inside and outside the courtroom premises.
The economic powerhouse of East Africa, Kenya is a key Western ally in the fight against terrorism, a burgeoning technology hub, and a stable democracy in a region shaped by autocrats and conflicts.
But the court battle that unfolded in the past week threatened to erode those democratic foundations, with elaborate allegations of foreign plots to rig the vote orchestrated by shadowy outside forces.
Even before the election result was declared on Aug. 15, giving Mr. Ruto a wafer-thin majority of about 233,000 votes that was sufficient to avoid a runoff, it was rejected by Mr. Odinga.
At the national tallying center in Nairobi, Mr. Odinga’s chief electoral agent, Saitabao Ole Kanchory, described the location as a “crime scene,” and denounced the vote as “the most mismanaged election in Kenya’s history.”
Four of the seven election commissioners had refused to verify the results on the day they were announced, pointing to what they called the “opaque nature” of the final phase of the tally. All four had been appointed to the commission last year by Mr. Ruto’s political nemesis and Mr. Odinga’s ally — Kenya’s current president, Uhuru Kenyatta.
But the chairman of the electoral commission, Wafula Chebukati, who had announced the results, stood by them.
Days later, Mr. Odinga himself called the election “null and void” and initiated a challenge in the Supreme Court.
But on Monday, the court rejected the claims by the four rebel electoral commissioners that the vote had been rigged, with the chief justice saying that they had failed to produce “any information or documents that show the election was compromised.”
“Are we to nullify an election on the basis of a last-minute boardroom rupture?” she said, referring to the dramatic events when the four commissioners walked out of the national tallying center hours before the result was announced. “This we cannot do.”
Along with his running mate, Ms. Karua, Mr. Odinga delivered dozens of boxes of papers to the courtroom. Multiple petitions and affidavits were also filed in the days after by members of the election commission and civil society.
Chief Justice Koome was critical of some of the sworn statements submitted to the court, saying that they contained speculative or false information, and she warned lawyers against submitting statements “on contentious matters because they run the risk of unknowingly swearing falsehoods.”
The Supreme Court judges narrowed the arguments down to several questions, including whether the electoral commission’s computer system had been hacked, whether Mr. Ruto attained over 50 percent of the vote to avoid a runoff, and whether there were discrepancies between the numbers of votes cast for presidential candidates and those for parliamentary seats.
For decades the outsider of Kenyan politics, Mr. Odinga contested this election as an establishment candidate, having struck a political pact with his longtime rival, Mr. Kenyatta, in 2018. The two men said that the deal, known as the “handshake,” would calm political tensions in the country after a hotly contested election a year earlier and heal the ethnic divides that have long characterized Kenyan politics.
But critics called it a self-serving deal between elites. One of its major proposals, a sweeping constitutional amendment that would have expanded presidential power, was rejected by the Supreme Court earlier this year.
Mr. Ruto, a wealthy businessman, cast himself as the underdog who was not a scion of a political dynasty. In rallies, he frequently spoke about his days as a chicken seller and appealed to what he called the “hustlers,” the millions of young people who, like himself in the past, were striving to make ends meet.
The election came as Kenya faced a severe drought that threatened the lives of millions of people. The country also faces dire economic straits, with mounting debt, high inflation rates, the war in Ukraine and the lasting aftershocks of the Covid-19 pandemic all undermining economic growth.
The authorities spent $374 million on the election, making it one of the most expensive in Africa.
Yet many young Kenyans stayed home on voting day, with turnout falling to 65 percent of the country’s 22.1 million registered votes, down from 80 percent in 2017.