Kenya's Supreme Court on Saturday upheld Uhuru Kenyatta's presidential election victory, throwing out a bid by his rival for a new poll that would have revived the spectre of violence.
The court unanimously ruled that the March 4 election had been fair and credible and that Kenyatta and his running mate had been "validly elected".
"The presidential election ... was conducted in a free, fair, transparent and credible manner in compliance with the provisions of the constitution and all relevant provisions of the law," Chief Justice Willy Mutunga said.
"It is the decision of the court that the 3rd and 4th respondents (Kenyatta and his deputy William Ruto) were validly elected," Mutunga said.
The ruling paves the way for Kenyatta, the son of Kenya's first president and one of Africa's richest men, to be sworn in as head of state on April 9.
The six judges dismissed petitions filed by Raila Odinga, outgoing prime minister and Kenyatta's main rival in the presidential race, and by civil society groups, over what they claimed was a series of irregularities that skewed the election results.
The petitioners had called for fresh elections to be ordered.
Kenya's last elections in 2007 were marred by widespread violence, with more than 1,100 people killed and several hundred thousand forced to flee their homes.
Odinga, who has called on his supporters to remain calm while the court reached its decision and who has repeatedly said he will abide by the judges' ruling, even if it went against him, will hold a press briefing later Saturday.
Mutunga said the judges would make the reasons for their decision public within two weeks.
Official results showed president-elect Kenyatta won 50.07 percent of the votes -- just making it over the 50-percent threshold needed to avoid a second-round ballot by some 8,000 ballots. He was declared the winner on March 9.
"It is important the process has come to an end," Kethi Kilonzo, counsel for one of the civil society groups that filed a petition said in a TV interview.
Television footage from Gatundu, the town where Kenyatta was born and raised, showed motorbike riders sounding their horns in triumph as they drove down the main street.
Tensions have been running high ahead of the ruling.
Odinga had urged his supporters to remain calm while he challenged the results. There were no immediate reports of violence from his strongholds.
Kenyatta and Ruto both face trial at the International Criminal Court in The Hague for crimes against humanity over their alleged role in planning the 2007-2008 post-election violence.
Police were out in force on Saturday around the building housing the court in central Nairobi, with Kenya's police chief David Kimaiyo warning gatherings around the court would not be tolerated.
Just after the announcement of the decision a group of some 200 supporters of Odinga was swiftly dispersed by police who used tear gas after earlier warning that protestors would not be allowed to gather around the court.
There were also reports of protests in Homa Bay and Kisumu, two towns in Odinga's western region stronghold.