Kenya's Supreme Court on Monday unanimously upheld the re-election of President Uhuru Kenyatta in last month's repeat presidential vote, paving the way for him to be sworn in next week.
Chief Justice David Maraga said all six judges dismissed the two legal challenges to the vote, but the opposition NASA coalition insisted the government was illegitimate.
Kenyatta's main challenger, NASA's Raila Odinga, said in a statement by his adviser Salim Lone that the ruling "did not come as a surprise" and said "it was a decision taken under duress", without giving evidence.
"We in NASA had repeatedly declared before this Supreme Court ruling today that we consider this government to be illegitimate and do not recognize it. This position has not been changed by the court ruling," the statement said.
Residents in the western city of Kisumu, where Odinga has strong backing, youths barricaded roads in protest at the court's decision, but there was no immediate response from the police, according to a Reuters witness.
Monday's ruling clears the way for Kenyatta's swearing-in on Nov. 28, but, given the opposition response, it is unlikely to end the worst political crisis in East Africa's richest and most developed economy in a decade.
Odinga had called for a "National Resistance Movement" after Kenyatta's election victory last month. It was unclear what shape that movement would take following the court's ruling. Kenyatta had said he would not engage in dialogue with the opposition until "constitutional options" had been exhausted.
This year's prolonged election season has disrupted the economy and forced the government to cut its growth forecast. Human rights groups say at least 66 people have died in bloodshed surrounding the votes in August and October.
The petitioners had argued, amongst other complaints, that the outcome should be voided because the election board did not seek fresh nominations after the Aug. 8 poll was invalidated, and because the vote was not held in each of Kenya's 291 voter constituencies.
The repeat election on Oct. 26 had been ordered by the Supreme Court after it nullified the results of the August election, citing irregularities in the tallying of votes - an unprecedented move on the continent.
The opposition boycotted the poll, which Kenyatta won with 98 percent of the vote. Some opposition supporters mobilized to prevent polls from opening in the west of the country.
"The court has unanimously determined that the petitions are not merited," Maraga said.
As a consequence, the presidential election of 26th of October is hereby upheld.
The judges' decision was met with applause in the courtroom from lawyers for the election board and Kenyatta. There was no immediate reaction on the verdict from Kenyatta.
Kenya, a U.S. ally in the fight against Islamists and a trade gateway to East Africa, has a history of disputed elections. A row over a 2007 poll, which Odinga challenged after being declared loser, was followed by weeks of ethnic bloodshed that killed more than 1,200 people.
Police said on Sunday at least four people were killed overnight in a Nairobi slum that is an opposition stronghold.
Odinga accused the government of being behind the killings, which followed at least five deaths on Friday as police tried to disperse opposition supporters. He also put the death toll in violence since he returned to Nairobi on Friday from an overseas trip far higher, at 31.
In several areas of the capital, riots broke out on Sunday in response to the deaths, as residents lit cars and buses on fire and police responded with teargas.
In last week's court proceedings, lawyers for both sides argued that the country was on the brink and would "plunge into the abyss" depending on the court's ruling.
A few dozen Kenyatta supporters waved Kenyan flags and danced outside the court after the ruling, and small celebrations broke out in the central city of Nyeri, a ruling party stronghold.
In downtown Nairobi, Elvis Kinyanjui, a vendor selling socks and watches, complained that politics had disrupted his business and said he hoped "next year business will be back to normal".
"Everyone is holding on to their shilling not knowing what tomorrow will be like," he said.
Kenyan shares headed higher and the currency strengthened against the dollar after the ruling, traders said. The markets dropped sharply when the court nullified the August vote.
Reporting by Maggie Fick and Duncan Miriri; Additional reporting by John Ndiso in Nairobi; Writing by Maggie Fick; Editing by Alison Williams