Kenyans have voted in national elections, but turnout was unusually low amid voter apathy and frustration over surging food prices, corruption and fears of violence in some areas.
Former political prisoner and veteran opposition leader Raila Odinga is competing with Deputy President William Ruto for the presidency.
Kenyans will also vote for legislators and local officials.
Provisional results started streaming in tonight, but official announcements will take longer.
Nic Cheeseman, professor of democracy at the University of Birmingham, said the race seemed to be much closer than opinion polls had predicted.
"This is the moment of truth - leaders on both sides will beseeing that they may lose. So the question now becomes are they willing to ... undermine Kenyan democracy," he said.
The electoral commission said turnout was around 60%, above the rate typical in many other democracies but still well short of the 80% seen in the last election.
"Kenyans are tired of waking up early and voting for a government that doesn't care," said Joshua Nyanjui at a polling station in the town of Naivasha, around 90kms northeast of the capital Nairobi.
Many young people did not even register to vote, electoral commission figures showed. Some said they were fed up of widening inequality and do not trust either candidate.
The 2007 and 2017 polls were marred by violence after disputes over alleged rigging.
In northern Eldas town, today's election was postponed for a day after violent clashes between rival sides, election officials said.
Mr Ruto, 55, has been President Uhuru Kenyatta's deputy for nine years, though the two have fallen out. Instead, Mr Kenyatta endorsed Mr Odinga, 77.
Mr Odinga's chosen running mate is former justice minister Martha Karua. If elected, she would be the first female vice president in a nation where women candidates often face violence.
Kenya is a stable nation in a volatile region, a close Western ally that hosts regional headquarters for Alphabet, Visa and other international groups. However, less than 0.1% of Kenyans own more wealth than the bottom 99.9% combined, according to Oxfam.
Some citizens queued for hours, joyous to support their candidates. But others were haunted by violence sparked by past election disputes.
Police were hunting the MP for Kimilili constituency, Didmus Barasa, after he allegedly shot a man dead.
In Dadaab in the north, journalist and eyewitness Mohamed Barud said two competing sides clashed using knives and machetes, seriously injuring three people.
"Whenever it nears the election period, I get scared," said Philip Wangoi, who was among a group of women and children sheltering in a church when it was set alight after the disputed 2007 election.
Purple ink marked his finger as a voter; old burn scars swirled across his hand.
Kenya's traditional ethnic voting dynamics may also have dampened turnout. The largest ethnic group, the Kikuyu, have provided three out of Kenya's four presidents.
This time, there is no Kikuyu candidate, although both front-runners have Kikuyu deputies.
Mr Ruto comes from the populous Kalenjin community, based in the Rift Valley, while Mr Odinga's Luo ethnic group have their heartland in western Kenya.
Some polling stations opened late and closed late; a few biometric kits used to identify voters failed to work properly. Some names were missing from lists in some areas.
In northern Garissa town, pastoralist Idiris Hussein Adan voted after four hours of delays, but said four of his sons could not because the worst drought in 40 years had forced them to take their livestock far away. More than 4 million Kenyans need food aid due to the drought, which was barely been mentioned during the campaigns.
The next president will have to tackle soaring food, fuel and fertiliser prices. They must also repay the loans that funded outgoing President Kenyatta's infrastructure boom.
Mr Ruto has sought to capitalise on growing anger among poor Kenyans by promising to provide loans for small enterprises.
Mr Odinga, who has competed unsuccessfully in four previous elections, promises to tackle corruption and make peace with political opponents.
To avoid a run-off, a presidential candidate needs more than 50% of votes and at least 25% of votes in more than half of Kenya's 47 counties.