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.