NAIROBI (Reuters) - Kenya's Supreme Court upheld Uhuru Kenyatta's presidential election victory on Saturday and his defeated rival quickly accepted the ruling, dousing fears of a repeat of the tribal bloodletting that blighted the country's last vote.
The decision cleared the way for Kenya's richest man to take the top job in east Africa's biggest economy, but left foreign powers with the headache of dealing with a leader charged with crimes against humanity at The Hague.
After the judgment, police fired shots in the air and teargas at hundreds of stone-throwing youths in the western city of Kisumu, a stronghold of defeated presidential candidate Raila Odinga, who had challenged Kenyatta's win. Protesters looted shops and burned tyres in the street.
But shortly after, Odinga made a nationally-televised statement, accepting the court's unanimous decision.
"The court has now spoken," Odinga told a news conference. "I wish the president-elect, honourable Uhuru Kenyatta, and his team well."
Kenya's outgoing president had called for calm ahead of the judgment which came five years after another ballot dispute triggered violence that left more than 1,200 dead.
"It is the decision of the court that the third and fourth respondents were validly elected," Chief Justice Willy Mutunga said in court, referring to Kenyatta and his running mate for deputy president, William Ruto.
He said the court had done its duty at a historic moment. "It is now for the Kenyan people, their leaders, civil society, the private sector and the media to discharge (their duty), to ensure that the unity, peace, sovereignty and prosperity of the nation is preserved," he added.
After a week of hearings, the six judges of the court had unanimously decided the March 4 vote was conducted in a free, fair and credible manner in line with the constitution, he said.
Peaceful voting in this year's vote, and the fact the dispute was played out by lawyers not machete-wielding gangs, has already helped repair Kenya's image as a safe haven for investors and tourists.
Paramilitary police, some on horseback, formed a security cordon around the court before the ruling. Police chief David Kimaiyo has repeatedly said he would not allow public rallies.
Kenyatta comfortably beat Odinga in votes won, but only narrowly avoided a run-off by edging above the 50 percent threshold.
Western donors are watching the fate of a regional trade partner and a country they see as vital to stability in a volatile area. They had also said before the victory was confirmed that a Kenyatta win would complicate relations.
He is facing charges at the International Criminal Court of crimes against humanity, accused of helping incite the violence after the 2007 vote. Kenyatta denies the charges and has promised to cooperate with the court to clear his name.
Western nations have a policy of having only "essential contacts" with indictees of the court. They say that will not affect dealings with the Kenyan government as a whole, but will worry the issue could drive a long-time ally of the West closer to emerging powers such as China.
David Cameron, prime minister of former colonial power Britain, wrote to Kenyatta to congratulate him and encouraged Kenyans to accept the decision of the court.
Neighbouring African states have also been keeping a careful eye on proceedings after they were hit by the knock-on effects when vital trade routes through Kenya were shut down five years ago.
Additional reporting by Joseph Akwiri in Mombasa, Hezron Ochiel in Kisumu and James Macharia in Nairobi; Writing by Edmund Blair; Editing by Andrew Heavens