Mr. Kenyatta, who comes from one of the richest, most powerful families in Africa and has been accused of bankrolling death squads that killed women and children during the chaos of Kenya’s election five years ago, was leading 54 percent to 42 percent over the second-place candidate, Raila Odinga, Kenya’s prime minister.
But there was a wrinkle.
Kenyan election law says that the winning candidate must secure more than 50 percent of “all the votes cast” and Mr. Odinga’s supporters say that the election commission must consider the more than 300,000 rejected ballots as part of the total. If that is the case, some analysts predicted that Mr. Kenyatta might not clear the 50 percent threshold, prompting a runoff.
Ahmed Hassan, the head of Kenya’s election commission, conceded that the number of ballots rejected for stray marks and other irregularities was “quite worrying,” though election observers said it was not particularly surprising given the complexity of these elections and that voters had six ballots in their hands, for national and local races.
As the results continued to trickle in, with Kenyans glued to their television sets and transistor radios, the grumblings were rising. Kenya’s police chief promptly banned all demonstrations, saying Kenya had “no history” of peaceful protests, and many shops here in Nairobi, the capital, remained shuttered, with shopkeepers not sure of what lies ahead. Police officers were everywhere, some wearing helmets and padded riot suits, others chugging through town in big trucks.
Preliminary results showed that Kenyan voters, who poured into the polls on Monday at dawn, with many then waiting 10 hours on their feet under a burning sun, voted overwhelmingly along ethnic lines. Some areas voted 98 percent for the politician from their ethnic group, while other areas, equally poor, with people in very similar circumstances, voted 98 percent in the opposite direction.
“I guess we haven’t come very far,” said Maina Kiai, a prominent Kenyan human rights defender. “We still use identity as the only factor in voting.”
This presidential election was the first one since 2007, when widespread evidence of vote rigging set off ethnic-based clashes that killed 1,000 people and brought Kenya’s economy to its knees. Enormous efforts were made this time around to move voters away from ethnicity and persuade them to consider other factors, like the candidate’s résumé or manifesto. The Kenyan media, considered one of the most independent and professional in Africa, even organized televised presidential debates, a first here.
But in the end, the presidential candidates who tried to gain momentum on issues-based campaigns, like Peter Kenneth and Martha Karua, got almost no votes. It seemed that most voters still felt the leader from their ethnic group was the best one to protect them — especially in an edgy environment where many fear a replay of post-election violence.
“The ethnic vote is often the one based on fear,” Mr. Kiai said.
Kenya’s demographics favor Mr. Kenyatta. His ethnic group, the Kikuyu, is the country’s largest and along with the Meru and Embu, which often vote with them, make up 22 percent of the population. He then chose William Ruto, a Kalenjin, to be his running mate, and the Kalenjin are the third-largest group in the country. Mr. Odinga, a Luo, chose a Kamba running mate, Stephen Kalonzo Musyoka, but their combined numbers are far below the Kikuyu-Kalenjin alliance.
Many Western officials have warned that Kenya will face “consequences” should Mr. Kenyatta win because of the grave charges against him.
But here in Kenya, the International Criminal Court may have actually driven turnout for Mr. Kenyatta and Mr. Ruto, who has also been charged with crimes against humanity. Many voters said they felt that if the two won, they would have a better chance of beating the charges.
“If Uhuru’s president, it will be harder to send him to The Hague,” said Terry Wamitha, a vegetable seller in Limuru, a Kikuyu-dominated area outside of Nairobi.
Another Kenyatta supporter, Joseph Koech, a road engineer, said, “this election isn’t about tribes, it’s about the West.”
He explained: “We believe the I.C.C. is a tool of Western countries to manipulate undeveloped countries. That’s why we voted for Uhuru, against the West.”
Kisumu, a city in western Kenya and Mr. Odinga’s ethnic stronghold, which exploded in riots in 2007 and 2008 during the last presidential election, was quiet on Tuesday.
“We’re just waiting,” said Christine Ololo Atieno, a seller of secondhand shoes and a passionate Odinga supporter. “People are still hoping that more votes will come in and things will change.”
Mr. Odinga says he was cheated out of winning the last election, and many analysts say that Kisumu could explode again if there is vote rigging and Mr. Odinga loses again.