NAIROBI, Kenya — Kenya’s election commission on Saturday declared Uhuru Kenyatta, the son of Kenya’s first president and one of the prime suspects in a case involving crimes against humanity, to be the winner of the country’s presidential race amid growing allegations of vote fraud and a refusal by the other leading contender to concede.

Mr. Kenyatta, who has been accused by prosecutors at the International Criminal Court in The Hague of bankrolling death squads during Kenya’s last election crisis, cleared the 50 percent threshold and avoided a runoff by the thinnest of margins, about 8,000 votes out of 12 million, or .07 percent.

Mr. Kenyatta’s trial is set for July, which means that Kenya, one of the United States’ closest allies in Africa, could soon have a president commuting back and forth from The Hague, simultaneously trying to run a country and keep himself out of jail.

Mr. Kenyatta has said that he is innocent and that he will cooperate with the court, but in his acceptance speech on Saturday he signaled that he wanted the world to back off.