Kenya’s president Uhuru Kenyatta has won a second term, but opposition candidate Raila Odinga claims the vote was rigged.
The country’s election commission says Kenyatta won Tuesday’s election with 54.27% of the vote, calling it “credible, fair and peaceful”.
Opposition leader Raila Odinga took 44.74%, said commission chairman Wafula Chebukati.
Nearly 80% of the 19 million registered voters cast their ballots.
“Having fulfilled the requirement by law… I therefore wish to declare Uhuru Kenyatta… as President-elect,” said Mr Chebukati.
Kenyan police fired tear gas to contain protests which broke out minutes after the winner was declared.
The protests erupted in Kisumu city, an opposition stronghold, and Mathare, a Nairobi slum, witnesses said.
James Orengo, one of Mr Odinga’s lieutenants and an election agent for the opposition coalition, said the process had been a “charade”.
He said going to court to challenge the result was not an option, but did not state what measures would be taken.
The newly elected president called for unity, saying “there is no need for violence”, and added that he wanted to work with Mr Odinga.
“I reach out to you. I reach out to all your supporters. To our brothers, our worthy competitors, we are not enemies, we are all citizens of the same republic,” he said.
President Kenyatta, 55, is a wealthy businessman and the son of Kenya’s first president.
Opposition leader Mr Odinga is a left-wing former political prisoner who also lost the 2013 vote to Kenyatta and took allegations of vote rigging to the country’s supreme court, which rejected his case.
The opposition claims figures released by the commission since Tuesday’s vote are “fictitious” and that “confidential sources” within the commission had provided figures showing Odinga had a large lead.
The election commission rejected the claims and said they contained basic mathematical errors.
Normal procedure calls for the commission to release final results after cross-checking its electronic tally with paper forms.
International observers have praised the handling of the election, with the European Union saying it had seen no sign of manipulation despite opposition complaints and scattered protests.
Election officials have spent the last few days confirming provisional results with checks of documents from polling stations across the nation.