In a sweeping rejection of claims that the Aug. 9 vote had been rigged, the court confirmed Vice President William Ruto as the country’s fifth president.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 Mr. Ruto as the fifth president of a country often seen as an indicator of democratic strength in Africa.In a lengthy judgment that rejected the claims by Mr. Ruto’s rival, Raila Odinga, that the vote had been rigged, Chief Justice Martha Koome swept aside claims of ballot stuffing, computer hacking and falsified results that she variously described as “sensationalism,” “hot air” and “a wild-goose chase that yielded nothing of value.”The unanimous verdict means that Mr. Ruto, the charismatic and populist vice president who pitched his campaign at Kenya’s “hustlers,” or young strivers, could be inaugurated as early as Sept. 13.Supporters of Mr. Ruto erupted in celebration as the verdict was announced, flooding the streets in towns across the Rift Valley, his main stronghold. Addressing supporters at his mansion in Karen, outside Nairobi, a jubilant and smiling Mr. Ruto lauded the court, extended a conciliatory hand to his rivals and promised to unite the country.“We are not enemies,” he said. “Let us unite to make Kenya a nation that everyone will be proud to call home.The court’s decision was yet another stinging defeat for Mr. Odinga, 77, a political veteran making his fifth bid for the presidency, having lost the first four. The election was hard fought: The court confirmed that Mr. Ruto had won 50.5 percent of the vote to Mr. Odinga’s 48.9 percent, a difference of about 233,000 votes. In a statement, Mr. Odinga said that while he respected the court’s verdict, he “vehemently” disagreed with it. “We find it incredible that the judges found against us on all nine grounds” and on “occasion resulted to unduly exaggerated language to refute our claim,” he said. At hearings last week, Mr. Odinga’s lawyers argued that Wafula Chebukati, the chairman of Kenya’s election commission, had swung the vote in favor of Mr. Ruto by conspiring with foreign agents who hacked into the commission’s computer system.President-elect William Ruto of Kenya speaks in Nairobi after the Supreme Court upheld his victory on Monday.Monicah Mwangi/ReutersBut Chief Justice Koome, flanked by six other judges, systematically demolished those claims in a judgment that took nearly 90 minutes to read out.The court 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.Chief Justice Koome dismissed claims by four of the country’s seven election commissions which dramatically disowned the election result minutes before it was announced. “Are we to nullify an election on the basis of a last-minute boardroom rupture?” she said. “This we cannot do.”And she offered scathing criticism of the most lurid rigging accusations, which she said were based on forgeries and hearsay, and warned lawyers against introducing sworn statements that were demonstrably based on “falsehoods.”Following the court proceeding by television in Kamagut village, about 200 miles north of Nairobi, where Mr. Ruto grow up, Esther Cherobon joined in the scenes of exultation. “I am very excited that someone who knows me by name, who never wore a shoe to school, has become president,” she said in a phone interview.It was “a miracle” that Mr. Ruto, whose campaign made much of his humble background and early years selling chicken on the roadside, had won, she added.Equally remarkable is Mr. Ruto’s rise to the top following accusations that he once committed crimes against humanity. A decade ago, Mr. Ruto was facing trial at the International Criminal Court in The Hague, which indicted him on charges of orchestrating communal violence after the 2007 election that resulted in over 1,200 deaths.The trial collapsed in 2016 after the Kenyan government withdrew its cooperation and key witnesses recanted their testimony. But the court did not formally acquit Mr. Ruto, then the country’s vice-president. The judgment on Monday was delivered to a courtroom packed with lawyers less than a month after a fiercely fought electoral battle that was closely followed across Africa and the world.Kenya’s stability matters to the region and beyond. The economic powerhouse of East Africa, it has emerged as 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.Some schools in the capital closed, and the police closed roads leading to the court, but worries of a backlash from Mr. Odinga’s supporters did not immediately materialize. In Kisumu, a major Odinga stronghold in western Kenya, traffic flowed and businesses reopened soon after the verdict was announced.Supporters of Raila Odinga in Nairobi last month. The court battle that unfolded in the past week had threatened to erode Kenya’s democratic foundations.Yasuyoshi Chiba/Agence France-Presse — Getty ImagesWhile some residents said they were shocked by the judges’ decision, they voted to abide by it. “Life has to go on,” Maurice Ogange, a motorcycle taxi driver, said by phone.That reaction stoked hopes that Kenya’s closely watched election, although messy and hotly disputed like the country’s previous three votes, could yet prove to be an example to the region.In contrast to recent elections, the vote was largely peaceful, although the chaotic scenes as the results were declared on Aug. 16, and the often sensational rigging accusations made in court last week, risked undermining voter confidence in the democratic system.When it became clear the result was going against Mr. Odinga, the top election official for his coalition denounced the vote-counting center as a “crime scene,” then rampaged through it with other supporters, clashing with security officials.It was not lost on anyone that the four rebel electoral commissioners were appointed last year by Kenya’s current president, Uhuru Kenyatta — Mr. Ruto’s political nemesis and Mr. Odinga’s ally.But the Supreme Court justices’ evenhanded treatment of the sensitive case over the past two weeks appeared to underscore the growing strength of Kenya’s senior judiciary. The judges narrowed a slew of accusations down to nine key questions, including whether Mr. Ruto had attained over 50 percent of the vote, avoiding a runoff. Since Friday they spent three sleepless nights to reach a unanimous decision, the deputy chief justice, Philomena Mwilu, said in brief remarks on Monday.“Now, you allow us to go home and sleep,” she said before the hearing adjourned.Other key institutions, however, emerged from the election damaged or discredited.While the verdict largely vindicated the election commissioner, Mr. Chebukati, he was not totally without fault in the eyes of the court. It suggested he overstepped his mandate in delivering the final result without backing from his own commissioners.The court also heard disturbing testimony that senior police, defense and security officials had tried to pressure Mr. Chebukati into denying victory to Mr. Ruto just hours before the result was announced, suggesting a dangerous rift in key state institutions.Despite the defeat, Mr. Odinga’s legacy as a champion of democracy remains undiminished. For decades he was the outsider in Kenya’s politics, a dogged opposition leader who served years in prison under the authoritarian leader Daniel arap Moi, who in 1982 accused him of fomenting an attempted coup.This time, however, Mr. Odinga was running as an establishment candidate thanks to a political pact that he sealed with Mr. Kenyatta in 2018. But that deal, known as the “handshake,” dismally failed to deliver the votes Mr. Odinga needed to win.Mr. Ruto’s candidacy was also riven with contradictions. A wealthy businessman, he cast himself as an underdog, playing up his humble past, and largely ignored that he has been in power as vice president under Mr. Kenyatta since 2013.But his appeal to what he called the “hustlers,” the millions of young Kenyans who, like his younger self, were striving to make ends meet, struck a chord with many.Even so, many young Kenyans were turned off by both candidates. Turnout fell to 65 percent of the country’s 22.1 million registered voters, down from 80 percent in 2017.Presidential ballot boxes taken to the court after the justices ordered ballots from some 15 polling stations to be recounted.Daniel Irungu/EPA, via Shutterstock More