By James Macharia
NAIROBI (Reuters) - The U.S. embassy in Kenya has warned its citizens of possible unrest this weekend when the Supreme Court is due to rule on a legal challenge to the outcome of the presidential election by losing candidate Raila Odinga.
Odinga alleged "rampant illegality" in the first-round victory this month of rival Uhuru Kenyatta, the son of Kenya's founding president, who has said the voting was "free and fair".
The case is a fresh test of Kenyan democracy five years after a disputed vote ignited deadly tribal violence.
American citizens number in the thousands in Kenya and form part of a large expatriate community in a country that is a hub for trade, multinational firms and the regional headquarters for U.N. agencies and other humanitarian organizations.
Analysts say a swift, transparent resolution of the petition will be critical to restoring Kenya's reputation as a stable democracy, following post-election violence in early 2008 that cost more than 1,200 lives in east Africa's biggest economy.
The six supreme court judges are widely expected to deliver a ruling by Saturday in line with a strict legal deadline.
The U.S. embassy warned its citizens to stay clear of any demonstrations, even if they appear peaceful.
"There could be a strong public reaction to the announcement; therefore, the U.S. Embassy strongly urges all U.S. citizens to avoid gatherings, demonstrations, downtown business areas, slums, and large crowds of any kind," the statement posted on the embassy website said.
The Supreme Court's verdict on the case is final, and both Odinga and Kenyatta have said they will abide by its decision. It remains to be seen how their supporters will react.
Should Odinga win his challenge, it would mean a new presidential race that would further unnerve markets and prolong uncertainty in the region's trade gateway.
Kenyatta, 51, can only be sworn in if the court upholds his victory. The president-elect also faces trial at The Hague in July on charges of playing a leading role in the killings that followed the 2007 election. Kenyatta denies the charges.
On Monday, the court ordered a partial recount of ballots from the broadly peaceful March 4 presidential election after Odinga alleged there were more votes cast at some polling stations than there were registered voters.
Chief Justice Willy Mutunga has repeatedly said the Supreme Court would handle the dispute fairly, and urged Kenyans to trust his court to deliver a verdict which they should accept.
Tuesday was the second day of pre-trial meetings to plan hearings for the petition filed by Odinga and two other petitions filed by civil organizations. The main hearings will be held on Wednesday and Thursday.
On June 23, 2012, the U.S. embassy warned of a threat of an attack on the Kenyan port city of Mombasa. A blast at a night club the following day killed at least one person.
(Editing by Alistair Lyon)