Kenya’s Supreme Court on Saturday unanimously upheld the results of this month’s presidential election, dismissing a challenge by the runner-up and clearing the way for the inauguration of Uhuru Kenyatta, who has been charged with crimes against humanity.

The decision came despite evidence of voting irregularities and ballot rigging in some parts of the country. But the six-judge bench decided that the problems were not widespread enough to alter the outcome of the election.

It remains to be seen whether Kenya will move forward peacefully or experience spasms of violence similar to those after the 2007 elections, which were also disputed. After the court decision, angry supporters of Prime Minister Raila Odinga, the runner-up, took to the streets in some Nairobi slums, and police fired tear gas at his supporters rallying outside the Supreme Court, according to the Associated Press.

Whether the violence spreads will depend on how Odinga and Kenyatta communicate to their supporters, said analysts and election observers. Odinga has publicly said he would respect the decision by the Supreme Court, regardless of the outcome.

“The election was conducted in a free, fair, transparent and credible manner in compliance with the constitution and all relevant provisions of the law,” said Chief Justice Willy Mutunga, who read the decision.

Kenyatta and his vice president-elect, William Ruto, have been indicted by the International Criminal Court at The Hague, accused of financing mobs that killed more than 1,000 people after the 2007 vote. U.S. diplomats and those of other Western nations had warned that there could be consequences for Kenya if the pair won the election. Both have proclaimed their innocence and said they would fight the charges. Their inauguration is scheduled for April 9.

Kenyatta, the son of Kenya’s founding father, Jomo Kenyatta, won the election with 50.07 percent of the vote, avoiding a runoff by 8,000 votes. Odinga received 43.3 percent in the election, in which more than 12 million Kenyans voted — the biggest turnout in the country’s history.

In a speech late Saturday, Ken­yatta, 51, promised to “work with, and serve, all Kenyans without discrimination whatsoever,” AP reported.

Odinga said he would accept the decision, adding that “the future of Kenya is bright. Let us not allow elections to divide us,” AP reported.

On Friday, the Supreme Court released the results after a recount of votes from more than 20 polling stations, suggesting that there were some discrepancies in the tallies as well as other irregularities. Odinga’s attorneys argued that the mistakes necessitated that the March 4 vote be nullified and that a runoff election be held. Kenyatta’s attorneys insisted that the vote was free and fair.

On Saturday, Mutunga, the chief justice, said the court would provide a detailed explanation of its decision within two weeks.

Kenyatta’s trial at The Hague is scheduled to begin in July, but his attorneys are asking prosecutors to drop the charges. This month, the court dropped charges against another of the accused, Francis Muthaura, former chief of Kenya’s civil service, after a key witness recanted his testimony. Some analysts have suggested that with Ken­yatta as president, witnesses may fear testifying against him.

Kenya is a key U.S. ally in the region, playing a significant role in fighting al-Shabab, an al­Qaeda-linked militia in neighboring Somalia. Kenya is also an economic powerhouse that is vital to regional stability.