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.

Mr. 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. Mr. 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 Mr. Odinga and his representatives have insisted that the vote was rigged and that he was the rightful winner.