The count was underway by gas-light across Kenya tonight in what is being seen as the country's most important election in a generation.
First light this morning revealed crowds of voters, many of whom spent the night outside polling stations in their determination to cast their ballots. A nervous start to the day was assured by the news that at least 15 people had been killed in pre-dawn attacks blamed on separatist groups along Kenya's Indian Ocean coast. Later, the country's deputy speaker of parliament said gunmen had attacked two polling stations near the border with Somalia.
The contest pits Raila Odinga, the man most observers believe was denied a narrow victory at the last polls against Uhuru Kenyatta, a politician due in the dock at The Hague for his alleged role in the post-election violence that killed more than 1,300 people in 2007.
Despite today's killings near Mombasa, the worst that most voters had to contend with for the rest of the day were epic queues produced by the combination of a record turnout and delays inflicted by a new computerised voter identification system. "They told us to come in large numbers and now we've come they can't handle us," said Calvin Odongo, a pharmaceuticals worker who was forced to wait for eight hours in the centre of Nairobi.
For the past five years, Kenya has been haunted by the aftermath of its last election where a rancorous campaign followed by a disputed result tore apart the country's patchwork of ethnic groups. Anthony Mbua was among the gangs of young men who rampaged through the city's slums as 2007 entered 2008 fighting and dying. Today the unemployed 30-year-old voted peacefully in Kibera, the vast and ethnically mixed slum which saw some of the worst violence: "We were looting and burning for the president we wanted," he said. "But not this time."
Ten buses a day have been emptying the slum of those who do not dare risk a repeat of the last election. But Rose Odhiambo, a tailor who lost her home and business last time, was among the majority who stayed. This time around a new constitution, a respected new head of the judiciary and an improved electoral authority has many Kenyans hoping for a fairer outcome. "We won't accept the wrong result," she warned. "The one who is going to win must win fair whether it's my candidate or not."
Sadly those sentiments have not been echoed by the main rivals for the presidency. Mr Odinga has told his supporters he can only lose if the contest is rigged and that he would not accept a rigged outcome. Meanwhile, Mr Kenyatta, who has poured an unknown amount of money into his campaign, has publicly fed the expectation that his Jubilee coalition will win with the 50 per cent-plus-one needed to take the presidency in the first round. A run-off between the pair, to be held within 30 days, remains the more likely result.
Both men have based their campaigns on ethnic alliances, recruiting the big men from Kenya's 40-plus tribes into their rival camps.
The election is widely seen as the 67-year-old Mr Odinga's last chance for the top job, while Mr Kenyatta and his running mate, William Ruto, need to win to protect themselves from the International Criminal Court.
Beyond its strategic importance as East Africa's biggest economy and hub for international security and aid operations, Kenya's election is closely watched for signs that the "Africa rising" narrative of economic growth is set to accelerate. The country's burgeoning middle class and diversified economy make it an ideal testing ground for the notion that progress on the continent is down to more than a repeat of past commodities booms.
Norbert Talam, a bank manager voting in the emerging middle class suburb of Buru Buru said his country was at a "crossroads" with a return to tribal clashes less likely than some analysts have predicted. He pointed to the rash of big firms like Toyota and Pepsi opening operations in the country.
"Kenya's on the verge of taking off," he said. "With a peaceful election the foreign investment will come and the sky is the limit."