James Kamau got up at 2 a.m. Tuesday and rushed to the polling station in Kibera slum four hours before it opened so that he could be one of the first to vote in favor of the president he worships, Uhuru Kenyatta.
Carolly Obonyo, 23, got to a polling station in another Kibera neighborhood at 4 a.m. to find a long queue. He waited six hours to cast his vote for change, supporting opposition candidate Raila Odinga in a closely fought election that some fear could reprise the postelection clashes of nearly a decade ago.
Turnout appeared to be high among the 19.6 million registered voters in a nation where people often vote according to ethnic allegiance, and amid ethnic favoritism in government and public sector posts that feed long-held grievances among groups that feel excluded.
Kenyatta 55, represents the Kikuyu, the nation's largest ethnic group, and his deputy and running mate, William Ruto, is a member of the Kalenjin, another of Kenya's biggest tribes. Both men were indicted by the International Criminal Court on charges of crimes against humanity after the 2007 election when violence flared across the country. But after government obstruction of the investigation and witnesses were killed, disappeared or withdrew their evidence, the prosecution was forced to drop both cases.
Odinga, 72, a Luo, is running for the fourth time, but his ethnic group has never produced a president. He has pledged to create jobs, end poverty and address the endemic corruption that has stifled Kenyan progress. There are six other candidates, none expected to poll more than a few percent of the vote.
The election is being closely watched for signs of voting fraud and violence after the results are announced, should the losing candidate fail to concede defeat. The result is expected within two days of the election.
Voting largely went smoothly, said Wafula Chebukati, chairman of the Independent Electoral and Boundaries Commission. In northern Kenya, election officials and voting materials had to be flown in by helicopter because of heavy rains. Some polling stations opened late, but voting was extended at those stations.
"We are happy to report that there are no major hitches reported from the 40,833 polling stations throughout the country apart from a few issues affecting some of the polling stations across the country, and we are addressing them accordingly," he told journalists.
But some voters complained of long delays, problems with biometric equipment to identify voters and names missing on the voter register.
Odinga tweeted that election officials had been frustrating opposition agents at polling stations.
Kenya, with a population of more than 46 million, is a major transport hub in East Africa with economic growth of nearly 6% a year. It relies on agriculture and tourism for most of its income, with 75% of the population reliant on farming or livestock herding.
A candidate needs 50% of the vote and more than 25% of votes in at least 24 of Kenya's 47 counties to avoid a second-round vote. In the 2013 election, Kenyatta narrowly avoided a runoff, a result that Odinga challenged in court without success.
Obonyo, a nursing student who grew up as an orphan in Kibera, said the government did little for slum dwellers.
"Tribalism is making the people angry. We don't want one of the two tribes to be in power forever," he said. "People get employed according to their tribe. Most of the people in the government are Kalenjin or Kikuyu," he said, referring to the ethnic groups of Kenyatta and Ruto. "It's been that way for a long period."
He hoped that if Odinga was elected, people would be appointed to government and public sector jobs on merit and ethnicity would play no role.
Kibera is a sprawling slum of rusted corrugated iron houses, open gutters, street traders and drifting smoke from cooking fires. The neighborhood buzzes with entrepreneurial energy, with micro businesses on every corner, such as women frying dough cakes or fish, barbershops, bars, furniture makers, shoeshine men, butchers and secondhand-clothing sellers.
But formal jobs are hard to find and the youth unemployment rate is high. The costs of rent, food, water and school fees are high, and traders complain that no one has money to spend.
"I blame the government because the economy has been low and has remained low while prices have continued escalating," said Ruth Agumba of Kibera, a 45-year-old vegetable seller with three children. "There are no jobs. Youth are idle all over, including my children. They have no jobs.
"I can never get ahead because my situation is hand-to-mouth," said Agumba, who voted for Odinga.
She wasn't concerned about possible violence after the election, even though her sister was shot dead by riot police in western Kenya in the violence that followed the 2007 election. If Kenyatta was announced the winner in a vote that Odinga did not accept, she would support protests, despite fears they could turn violent.
"Everyone dies, after all. We need democracy, so if the youth take part in demonstrations in order to get democracy, it's OK. If it turns violent, it's OK because we're fighting for democracy."
Ann Wafula, 41, an opposition supporter, said her hairdressing business of 19 years had never struggled as much as it has lately.
"Business is very bad. It's difficult to support four children as a single mother. The problem is clients. They don't come because they don't have any money. We have to do without some things. Sometimes you cannot even afford money for food and school fees are a problem.
"We need a change of government because Kenya is heading in the wrong direction."
But Kamau, a government supporter and commuter minibus driver, said Kenyatta had brought many benefits to Kenya, including improvements to roads and infrastructure, and moves to stop corruption.
"The economy is good, according to me, because corruption has gone down. Although salaries vary, those who are paid more get to lift the others who are poor out of poverty."
He said for most Kenyans, the most important result was a peaceful election.
"First of all, we are peace-loving people, and there's no bad or good government, but what is important is peace among Kenyans."
Still he doubted that opposition supporters would accept the result if Odinga was defeated by Kenyatta. He feared the possibility of a contested result and violence.
"Odinga is like that. I've never seen him concede defeat. The main problem Kenya has is the opposition. Whether they win or lose, they always bring controversies.
"We don't know what will befall the country or what he will do."
Kenyatta said he was confident of victory after casting his vote Tuesday.
"I feel very positive," he told journalists. "We have run a very positive campaign telling Kenyans what we have done, what we intend to do, and I believe Kenyans have the ability to choose and reflect on the direction that they want us to go. I believe they want us to move forward, they want us to continue living in peace harmony and unity, and I believe they want us to have progress."
Odinga said he had prepared a victory speech but not a concession speech.
"I have a universal speech because I am confident that I am going to win, but in the unlikely event that I lose, I don't need a speech as I will speak from the heart," he said. He said the opposition was conducting its own tally of votes to ensure the result was not rigged.