Uhuru Kenyatta wins presidency by 4,000 votes according to early results likely to be challenged in court by rival Raila Odinga

A man wanted for crimes against humanity has won the Kenyan presidential election by just over 4,000 votes, according to early figures released by the election commission.

Uhuru Kenyatta, the son of a former president and current deputy prime minister, won 50.03% of the vote, just enough to avoid a second round against Raila Odinga, the prime minister, who will probably challenge the results.

The election of Kenyatta raises diplomatic problems for Kenya and the international community because he has been accused of crimes by the International Criminal Court in The Hague because of his actions after the 2007 elections which led to 1,200 deaths.

Both sides relied heavily on their ethnic groups in a nation where tribal loyalties outweigh ideology at the ballot box. Kenyatta is a Kikuyu, the biggest of Kenya's many tribes; Odinga is a Luo. Both had running-mates from other tribes.

John Githongo, a former senior government official turned whistleblower, urged the rival coalitions, Odinga's CORD and Kenyatta's Jubilee, to ensure calm. "Jubilee and CORD, what you and your supporters say now determines continued peace and stability in Kenya. We are watching you!" he said on Twitter.

From the early hours of Saturday after provisional results emerged, Kenyatta's joyous supporters thronged the streets of Nairobi and his tribal strongholds, lighting fluorescent flares and waving tree branches and chanting: "Uhuru, Uhuru".

But tensions rose in the heartlands of Odinga, who trailed with 43.28% of votes. "No Raila, no peace," Odinga supporters chanted as security forces stood by in Kisumu, a city where violence flared in 2007.

A close adviser to Odinga, who lost in the 2007 race, said his candidate would not accept the result and would launch a legal challenge if Kenyatta was officially declared the victor.

"He is not conceding the election," Salim Lone told Reuters, speaking on behalf of Odinga. "If Uhuru Kenyatta is announced president-elect then he will move to the courts immediately." Odinga's camp had said during tallying that the ballot count was deeply flawed and had called for it to be halted. But they promised to pursue any disputes in the courts not the streets.

Provisional figures displayed by the electoral commission showed Kenyatta won 6,173,433 votes out of a total of 12,338,667 ballots cast. Odinga secured 5,340,546 votes. The first-round win must be officially confirmed on Saturday by the Independent Electoral and Boundaries Commission.

Diplomats believe that Kenyatta must co-operate with The Hague to ensure smooth international relations. "It won't be a headache as long as he co-operates with the ICC," said one western diplomat. "We respect the decision of the majority of the Kenyan voters."

Kenyans hope this vote, which has until now passed off with only pockets of unrest on voting day, will restore their nation's reputation as one of Africa's most stable democracies after killings last time left more than 1,200 dead.

Many Kenyans have said they are determined to avoid a repeat of the post-2007 chaos that brought the economy to a halt. Church leaders in Kisumu, in the west of Kenya that was devastated five years ago, sought to defuse tension this time.

"Our vote was stolen and we're angry," said Denis Onyango, a 28-year-old mechanic, as hundreds of supporter gathered with members of the security forces nearby. "Why did they bring such huge security here if the vote was to be free and fair?"

But some in the city accepted the outcome, more confident this time round that Kenya's institutions had ensured a fair vote. "I urge our candidate to forget the presidency and let the will of God prevail," said Diana Ndonga, a cloth vendor.

Many shops stayed closed as a precaution in the port city of Mombasa, another Odinga stronghold, but streets were calm.

"We are heading for a bleak future where the economy goes down and international relation sour because of the ICC case," said Athumani Yeya, 45, a teacher in the city.

But some were hopeful that Kenyatta could bring change. "We are celebrating. Even with the ICC case in Holland, the people of Kenya still have faith in him," said Thomas Gitau, 25, a barefoot car washer on a main Mombasa street. "We hope he can fix infrastructure and security so we have more jobs."

© Guardian News and Media 2013