Uhuru Kenyatta narrowly won Kenya's presidential election Saturday, urging calm and pledging to work with rivals and cooperate with the international community.
Kenyatta, son of Kenya's founding president and one of Africa's richest men who also faces an international crimes against humanity trial, scraped by with 50.07 percent of the vote to avoid a runoff against his closest rival Raila Odinga.
However Odinga, the outgoing prime minister, said he would contest the results in court, raising tensions following the key poll.
Odinga's charges on Saturday echo accusations in 2007 presidential polls when he alleged he was robbed of victory, with disputed results triggering bloody ethnic violence in which more than 1,100 people were killed.
"We have highlighted so many irregularities in the tallying process," Odinga told reporters, shortly after the Independent Electoral and Boundaries Commission (IEBC) declared Kenyatta the "duly elected president".
The rigging claims however have been dismissed by Kenya's electoral commission.
Kenyatta, dressed in a suit and red tie, beamed a wide smile as he waved his official victory certificate from the IEBC to loud cheers from the crowd.
But shortly afterwards Odinga -- in his third failed attempt at the top job -- said his party would challenge the result at the Supreme Court, adding he had "faith in the judiciary and the ruling will be respected."
Political loyalties in Kenya are largely based along ethnic lines, and while Kenyatta's majority Kikuyu people and the new found Kalenjin allies of his running mate William Ruto partied, the Luo of Odinga mourned their loss.
"Any violence now could destroy the country forever, and that would not serve anyone's interests," warned Odinga, who won 43.31 percent of the vote.
But Kenyatta offered "my older brother" Odinga an olive branch, telling thousands of his party loyalists that he wanted to work with him "in moving our nation forward."
The new president-elect also called on his celebrating supporters not to laud it over those they have defeated, urging them in being "modest in our victory."
-- Odinga alleges fraud but urges peace --
Kenyatta's 50.07 percent of the vote, according to the election commission figures, narrowly broke the 50-percent threshold needed to avoid a second round poll by around 8,400 votes.
The 51-year-old outgoing deputy prime minister -- charismatic and able to appeal to all classes -- will become the first leader to take power whilst facing trial in The Hague-based International Criminal Court (ICC).
Both Kenyatta and his future vice-president Ruto, 46, face ICC charges over the violence in the aftermath of the 2007 elections, including orchestrating murder, forcible transfer and persecution.
Concerns were high as to how Odinga loyalists would react to the results, five years since the wave of bloodshed following the disputed polls.
In the western town of Kisumu, an Odinga stronghold and one of the worst hit areas by violence in 2007, hundreds of youths chanted "no Raila, no peace" at armed police, but they later dispersed peacefully after appeals from community leaders.
"We can't accept this -- we are ready to die, we are ready for anything," said businessman Joshua Owino, a Luo like Odinga from Kisumu.
There have been no major incidents of violence reported on Saturday beyond a few scuffles between police and gangs of youths.
But as Odinga prepared his legal challenge, the international community urged calm, with US Secretary of State John Kerry calling for Kenyans to "peacefully address any disputes".
Former UN chief Kofi Annan, who helped broker peace after the 2007-8 violence, said Kenya faced "a test of the strength" of its democracy but that he was confident the east African country would "emerge stronger" in the end.
Former colonial ruler Britain, in a message echoed by the European Union, urged people "to accept defeat or take any disputes to the courts".
Excited crowds of thousands chanting Kenyatta's name poured onto the streets of towns across the country after figures were released in the early hours of Saturday morning, dressed in the red colours of Kenyatta's party.
Kenyatta will likely become the second African leader the ICC wants to put on trial, even as both he and Ruto protest their innocence and have repeatedly said they would cooperate with the court.
"We recognise and accept our international obligations and we will continue to co-operate with all nations and international institutions," Kenyatta said in his first public speech after winning the vote.
But he added -- to roars of applause from his supporters packed into a giant hall -- that the international community should also "respect our sovereignty".
Sudanese President Omar al-Bashir faced trial on war crimes charges at the ICC when he was re-elected in 2010, but has always defied an arrest warrant from the court.