Raila Odinga, who was narrowly defeated by Kenyatta, said he still believed that the election was marred by irregularities. But he called on Kenyans to unite around Kenyatta as president for the sake of peace.

"The court has now spoken. I wish the president-elect, honorable Uhuru Kenyatta, and his team well," Odinga told a news conference in Nairobi, the capital.

Violence was largely averted amid a heavy security presence in Nairobi's slums and Odinga strongholds late Saturday. There were reports of clashes in some areas, but Odinga's swift acceptance of the verdict and call for peace helped allay fear of widespread rioting.

In the western city of Kisumu, a largely pro-Odinga area, protesters looted shops and burned tires, Reuters news service reported. Security forces dispersed the demonstrations by firing live rounds and tear gas canisters. Police also fired tear gas to drive away protesters outside the Supreme Court in Nairobi.

Kenyatta's supporters flooded into the streets of the capital after the ruling, honking horns, blowing plastic trumpets, dancing and cheering. But the situation in Kibera, Nairobi's largest slum, was still tense Saturday evening, with Odinga supporters huddled in unhappy groups, discussing the court's verdict.

Kibera was one of the main scenes of violence after the disputed December 2007 election, when tribal violence left as many as 1,500 people dead.

"This judgment is for the mighty. We small local people didn't get justice at all," said one Kibera resident, Mary Oloo, 37, expressing anger that the court had rejected evidence of voting fraud.

The owner of a small food store in Kibera, who gave his name only as Ouma, was so angered by the decision that he threatened violence. "We are going back to street justice," he said. "Whoever will die, will die. We can't trust this government of thieves."

Kenya's toughly fought election and the disputed result had prompted fear of a repeat of the widespread chaos that followed the last vote. In fact, some critics complained, Kenyans were so keen to avoid such a repeat that the nation's news media downplayed missteps by the Independent Electoral and Boundaries Commission.

Despite the heavy deployment of security forces that was required to impose calm, the local media also hailed this year's relatively peaceful vote as a sign of Kenya's political maturity.

However, the disputed result and entrenched tribal voting patterns indicate that the electoral fault lines remain unresolved, with continuing potential to disrupt democracy. The country's winner-take-all brand of politics, which is often marred by corruption, has led some tribes to feel excluded from the corridors of power.

Many Kenyans nonetheless are hoping Kenyatta will embrace a more inclusive style that shares government jobs and contracts based on merit, not ethnicity.

The Supreme Court decision leaves the country with its two top officials facing trial on international charges. Kenyatta and his running mate, William Ruto, have been indicted by the International Criminal Court in The Hague of charges of crimes against humanity, accused of inciting post-election violence in 2007 and 2008. Both maintain that they will clear their names.

The pending charges have created a delicate situation for Western nations, which normally have a policy of shunning war crimes suspects. But there is doubt about whether witnesses will have the courage to testify against the country's two most powerful men; several have already recanted their statements.

As for the case before Kenya's Supreme Court, Odinga's political alliance, CORD, and a group of civic activists, the African Center for Open Governance, filed petitions challenging results that saw Kenyatta avoid a runoff by a slim margin, about 8,000 votes.

Odinga's lawyers argued that the election was fraught with irregularities and that Kenyatta failed to win the outright majority needed to avoid a runoff election. But the court rejected efforts to introduce evidence on those irregularities, saying it was presented too late. The constitution stipulates strict deadlines on election challenges to ensure that disputes do not drag on.

On Saturday, Odinga criticized the court's refusal, saying that "in the end Kenyans lost the right to know what indeed happened."