NAIROBI, Kenya — President Uhuru Kenyatta on Friday was officially declared the winner of a bitterly disputed election in Kenya, but his opponent, Raila Odinga, refused to concede defeat, criticizing the vote as a "charade" and edging the country closer to violence.
Kenyatta, 55, was re-elected with just over 54 percent of the vote in Tuesday's election, easily surpassing the 50 percent threshold needed to avoid a runoff, according to an announcement from the Independent Electoral and Boundaries Commission. Odinga, 72, the opposition leader, received 44.7 percent of the vote.
After a campaign marred by accusations of vote-rigging, fears of violence and the killing of a top election official, the vote was carried out peacefully and, according to international observers, fairly. There were relatively few protests in the days that followed, as political leaders, including members of the opposition, appealed to the public to remain calm.
But Odinga and his representatives have insisted that the vote was rigged and that he was the rightful winner.
On Friday, Odinga's party, the National Super Alliance, refused to take part in the announcement of the election results, accusing the commission of releasing the outcome before addressing its concerns. Top opposition party officials also indicated that they were unwilling to resolve their claims about election fraud in court, in comments that could be interpreted by supporters as a call to protest.
Protests in several opposition strongholds erupted shortly after Kenyatta's victory was declared. Police officers equipped with riot gear moved into some areas of Nairobi, the capital, and Kisumu, Kenya's third-largest city and Odinga's birthplace, where tear gas was used and live bullets were fired at protesters, according to witnesses.
In 2007, a vote that was widely believed to have been flawed touched off bloodshed that left at least 1,300 people dead and 600,000 displaced. Voting systems in 2013 were afflicted by widespread malfunctions that led to renewed accusations of vote-rigging, and more than 300 people were killed in postelection violence. Odinga has said he was robbed of victory because of vote-rigging in those last two contests.
A senior opposition party official, James Orengo, described the election as "an entire charade." The counting process, he said, was "a disaster." Orengo also rejected calls from election observers to take any grievances to court. "Going to court for us is not an alternative," he said. "We have been there before. It's not an alternative."
In 2013, Kenyatta won by a tiny margin, prompting Odinga to ask the Supreme Court to invalidate the election, a petition that proved unsuccessful.
On Thursday, Odinga's running mate, Kalonzo Musyoka, issued what seemed to be a call for supporters to go out into the streets when they were given a signal.
"There may come a time when we need to call you into action," Musyoka said.
Since Tuesday's election, Odinga has claimed that election commission servers had been hacked to award Kenyatta a 10-point lead. Odinga, a former prime minister who was running for president for a fourth time, described the election as a "fraud." Then, on Thursday, he said that he had won 8.04 million votes, to 7.75 million votes for Kenyatta.
Just days before the election, a senior official in charge of voting technology, Christopher Msando, was found dead, and there were signs he had been tortured. His death, which is being investigated with the help of U.S. and British authorities, raised questions about the integrity of the electoral process and created an atmosphere of anxiety and mistrust among voters.
Hackers, Odinga told reporters this week, had used Msando's credentials to gain access to the servers and to alter results.
The chief executive of the electoral commission, Ezra Chiloba, stated that there had been no foul play in this week's election. "There were no external or internal interferences with the system at any point before, during and after the voting," he said.
Wafula Chebukati, chairman of the commission, said that hackers had tried but failed to break into the servers.
International observers have widely applauded the electoral commission's conduct, noting that the results were based on paper documents that were verified at polling stations, not on the electronic transmission of the votes.