Kenya's Supreme Court on Friday nullified President Uhuru Kenyatta's election win last month as unconstitutional and called for new elections within 60 days, shocking a country that had been braced for further protests by opposition supporters.
Mr. Kenyatta said he "personally disagrees" with the ruling but respects it, but he lashed out at the judges, saying that "six people have decided they will go against the will of the people." He called for peace in a country where some elections have been followed by deadly violence.
No presidential election in the East African economic hub has ever been nullified. Opposition members danced in the streets, marveling at the setback for Kenyatta, the son of the country's first president, in the long rivalry between Kenya's leading political families.
"It's a very historic day for the people of Kenya and by extension the people of Africa," said opposition candidate Raila Odinga, who had challenged the vote. "For the first time in the history of African democratization, a ruling has been made by a court nullifying irregular election of a president. This is a precedent-setting ruling."
The six-judge bench ruled 4-2 in favor of the petition filed by Mr. Odinga. He claimed the electronic voting results were hacked into and manipulated in favor of Kenyatta, who had won a second term with 54 percent of the vote.
The court did not place blame on Kenyatta or his party. It said the election commission "committed illegalities and irregularities ... in the transmission of results, substance of which will be given in the detailed judgment of the court" that will be published within 21 days.
Odinga's lawyer had argued that a scrutiny of the forms used to tally the ballots had anomalies that affected nearly 5 million votes.
Commission chairman Wafula Chebukati said Friday they will make personal changes before the new vote, and he invited the prosecution of any staffer found to be involved in malpractice.
Odinga called for the election commission to be disbanded.
The lead counsel for the president, Ahmednassir Abdulahi, told the court that the nullification was a "very political decision" but said they will live with the consequences.
International election observers, including former Secretary of State John Kerry, had said they saw no interference with the vote.
Two dozen countries including the United States, which already had congratulated Kenyatta on his victory, issued a joint statement Friday saying the court's ruling "demonstrated Kenya's resilient democracy and commitment to the rule of law."
Odinga, a longtime opposition candidate and the son of Kenya's first vice president, had unsuccessfully challenged the results of the 2013 vote that Kenyatta won. Odinga's supporters at first had said they would not go to court this time but filed a petition two weeks ago.
Kenya had been braced for further protests as the court prepared to rule, with police deployed to sensitive areas of the capital, Nairobi, and streets near the court were barricaded. Human rights groups have said police killed at least 24 people in unrest that followed the Aug. 8 vote.
Instead, opposition supporters exploded in celebration.
"Thank you, Jesus!" one woman shouted. "I'm telling, God is on our side."
"This has shown all (election) observers did not do their job. We want an apology," said John Wekesa, who was dancing outside the court.
Unease around the election rose when the official who oversaw the electronic voting system was found tortured and killed days before the vote. But the unrest following the vote was far calmer than the post-election violence a decade ago that left more than 1,000 people dead.
"We are not at war with our brothers and sisters in the opposition because we are all Kenyans," Kenyatta said on national television. But he added: "Five or six people cannot change the will of 45 million people."
This story was reported by The Associated Press.