Kenya’s President Uhuru Kenyatta has been re-elected following Tuesday’s vote, the national electoral commission has announced.
Mr Kenyatta, in office since 2013, took 54.3% of votes, ahead of his rival Raila Odinga, with 44.7%.
After the official announcement, Mr Kenyatta said observers had ensured a “free, fair and credible election”.
But the opposition rejected the results even before they were declared, calling the process a “charade”.
International observers have endorsed the election.
Earlier, Mr Odinga’s supporters said he had won, and published their own figures. The electoral commission said this was “illegal and premature”, and said basic mathematical errors had been made.
Many observers fear a repeat of the violence after the disputed election 10 years ago when more than 1,100 Kenyans died and 600,000 were displaced.
One of the leaders of the opposition Nasa alliance, Musalia Mudavadi, said before the results announcement that its concerns about the poll had not been adequately addressed.
Nasa had complained of fraud and hacking.
Another top opposition official, James Orengo, said the coalition would not be taking its issues to court, raising the spectre of street protests.
He hit out at international observers, including former South African President Thabo Mbeki and former US Secretary of State John Kerry, casting doubt on their credentials.
“Nobody should think this is the end of the matter,” he said.