Four out of six judges upheld a petition filed by opposition candidate Raila Odinga, who claimed the re-election of President Uhuru Kenyatta was fraudulent.
“The presidential election was not conducted in accordance with the constitution, rendering the declared results invalid null and void,” Chief Justice David Maraga said, ordering fresh elections within 60 days.
In a decision that surprised many observers, the court agreed with opposition arguments that the electoral commission had committed irregularities that invalidated the poll.
Odinga was jubilant as he welcomed what he called a “precedent-setting ruling” by the court.
“For the first time in the history of African democratization, a ruling has been made by a court nullifying the election of a president,” he said. “This indeed is a very historic day for the people of Kenya and by extension the people of the continent of Africa.”
Odinga also railed against the national election body, the Independent Electoral and Boundaries Commission, which said it would brief the press Friday afternoon local time.
“We have no faith in the electoral commission as currently constituted,” Odinga said.
“They have committed criminal acts. Most of them actually belong in jail and therefore we are going to ask prosecution for all the electoral commission officials who have committed this monstrous crime against the people of Kenya.”
He added: “This is a triumph for the people of Kenya.”
Kenyatta lawyer: ‘Very political decision’
Kenyatta has not yet publicly responded to the ruling. But his spokesman Manoah Esipisu tweeted that he would address the nation shortly.
Kenyatta’s lead counsel, Ahmednassir Abdulahi said in court that his client wanted to see the full judgment to understand how the alleged irregularities would “obliterate” his 1.4 million vote winning margin.
“My lord it’s obvious, and I’m not afraid to say, that this is a very political decision you have made this morning but we will live with the consequences,” Abdulahi said. He added that the will of the people would prevail.
As news of the court’s decision spread, cheers and celebrations could be heard on the streets in parts of the capital, Nairobi. It’s not yet clear if the ruling will spark public protests.
The Supreme Court has seven members but can conduct proceedings as long as five judges are present. Six judges participated in Friday’s ruling.
Trading on Kenya’s stock exchange, the Nairobi Security Exchange, was briefly suspended following the ruling but has since resumed.
“There was heavy selling, prices were coming down, there was a level of panic selling in that limited time,” said its chief executive, Geoffery Odundo. “This outcome people are yet to digest what it means. We have no precedent so investors are a bit cautious. Now we are seeing some level of calm.”
Odundo said he did not plan to halt trading again. “It’s more now how the messaging from the prospective leaders comes out. I suspect everyone is going to follow the law and the constitution,” he said.
A spokesman for the Nairobi Security Exchange, Kuria Waithaka, earlier told CNN: “People are jubilant, the rule of law has been upheld.”
After Kenyatta, the 55-year-old son of the country’s founding President, was declared the winner last month by 54% to 45% for Odinga, violence erupted in some areas. At least 24 people lost their lives nationwide.
Most of the demonstrators were supporters of Odinga, who had rejected the results and called the vote rigged. National election officials dismissed the accusations, however, saying the vote was free and credible.
More than 400 international election monitors were also deployed across the country to monitor voting, the tallying process and the post-election period.
Former US Secretary of State John Kerry, who served as an election observer for the Carter Center, said then that while there were “little aberrations here and there,” the election was not rigged.
Any unrest in Kenya could have ripple effects far beyond the nation of 47 million people.
As the largest economy in East Africa, Kenya is a crucial trade route to the continent and provides an important buffer of stability in a region that includes the fledgling Somali government and the politically tense Sudan and South Sudan.
Although Kenya’s 2013 election was mainly peaceful, the country plunged into widespread violence in the aftermath of the 2007 vote.
More than 1,000 people were killed in months of bloodshed following the 2007 election after Odinga — defeated by then-President Mwai Kibaki — claimed the vote was rigged.
CNN’s Farai Sevenzo reported from Nairobi and Laura Smith-Spark wrote from London. CNN’s Briana Duggan and Katie Polglase contributed to this report.