KISUMU, Kenya — Kenyan officials were compiling the results early Wednesday after millions of Kenyans went to the polls to pick their next president, the culmination of a campaign dominated by concerns about the potential for vote-rigging and fears that the country would be plunged into violence once the winner was announced.

In the days leading to this year’s vote, fake news reports, candidates’ accusations of peddling hatred and electoral fraud, and the killing of a top election official cast further doubt on the fairness of the race between President Uhuru Kenyatta, 55, leader of the Jubilee Party, and Raila Odinga, 72, a former prime minister who was making his fourth, and possibly last, bid for the presidency.