By Edmund Blair

NAIROBI (Reuters) - Kenya's outgoing president called for his nation to stay calm when a court rules on Saturday on a legal challenge over the presidential election result, seeking to avoid a repeat of the tribal bloodbath that followed a disputed vote five years ago.

Orderly voting on March 4 after which Uhuru Kenyatta was declared victor has gone a long way to restoring Kenya's image as one of Africa's more stable democracies. And this time round, a row over the result has played out in court not the street.

But the final test comes when Kenyans hear from the Supreme Court whether it upholds Kenyatta's win or orders a new vote that would give another chance to defeated Raila Odinga, who disputed the result declared on March 9 after a five-day count.

Kenyatta, whose win would pose a headache for Western donors because of charges he faces in the Hague over the 2007 violence, was well ahead of Odinga in total votes but had only just enough to exceed the 50 percent threshold to avoid a run-off.

"As the country awaits the Supreme Court ruling which is due this Easter weekend, I call upon all of us to accept the ruling and maintain peace," President Mwai Kibaki said in a message to mark the Christian holiday.

"Kenyans should resume their routine economic activities as soon as possible to return normalcy in the country," he said.

East Africa's biggest economy was hammered when the December 2007 vote was followed by weeks of ethnic rioting that killed more than 1,200 people, scaring away investors and tourists. Growth has not yet recovered to levels before the 2007 vote.

Neighbors, some of whose economies were hurt when their trade routes through Kenya were shut down five years ago, have been watching warily. So too have Western donors, who see Kenya as a vital ally in the regional battle against militant Islam.

Many ordinary Kenyans, even in the flashpoints of five years ago, insist there will not be re-run of the violence, partly because of greater confidence of a fair adjudication by the judiciary, reformed after 2007 with changes in its top echelon.

"TEST FOR TOLERANCE"

"It is hard to know where the truth lies," said John Okello, 45, a taxi driver in Kisumu, a city in western Kenya devastated by violence last time. "Let us leave that to the courts. I believe they will grant us credible justice."

But voting patterns in Kenya are still largely determined by tribal loyalties, leaving room for sparks from the losing side. Many backers of Odinga, a Luo who also lost the 2007 vote, are convinced the election was unfair, just as Kenyatta's supporters from his Kikuyu tribe are sure their man won.

Western diplomats said they expected calm to prevail, but the U.S. Embassy still issued a warning this week to its citizens in Kenya about possible unrest.

Both candidates said they would respect the ruling and said they would keep any disputes off the streets.

"Our real test for tolerance was when the presidential results were announced," said Elikana Mukofu, 34, a guard at a nightclub in the port of Mombasa, another hot spot. "If we didn't disintegrate into violence at that time, then for sure this judgment will have no impact on our emotions."

Kenya's Supreme Court met for a last brief session on Friday so legal teams could review results of recounts ordered in 22 of the 33,400 polling stations after Odinga said more votes were cast than registered voters.

"Keep your cellphones open, because we don't know when we are going to summon you tomorrow (to issue the ruling)," Chief Justice Willy Mutunga told lawyers at the end of the session where both sides said the recount supported their arguments.

Odinga's team also argued that the failure of technology in tallying undermined the vote. Rival lawyers said any irregularities or technical hiccups had an insignificant impact and did not change the overall outcome.

International observers said voting itself was credible, but diplomats say observers did not watch the full five-day count.

If confirmed, a win by Kenyatta, the son of Kenya's founding president, will complicate ties for Western nations because he faces charges of crimes against humanity at the International Criminal Court related to the violence after the 2007 vote.

He denies the charges and has promised to clear his name.

Western states have a policy of having only "essential contacts" with indictees of the court. They say that will not affect dealings with the government as a whole but face a delicate balancing act to avoid driving a long-time ally of the West closer to emerging powers such as China.

(Additional reporting by Hezron Ochiel in Kisumu and Joseph Akwiri in Mombasa; Editing by Louise Ireland)