Kenyans are eager to avoid a repeat of the 2007 election.
At the time, the nation plunged into ethnic violence after Odinga disputed results that declared the incumbent president, Mwai Kibaki, as the winner, alleging the election had been rigged.
Protesters took to the streets, where supporters of both camps fought one another.
More than 1,200 people were killed and hundreds of thousands displaced -- the worst violence since the nation gained independence. Clashes ended with the formation of a power-sharing government with Kibaki as president and Odinga as prime minister.
While the poll has been relatively peaceful this time, authorities said at least 10 people were killed in isolated incidents on the coast.
Leading up to this election, the candidates declared they would settle any voting disputes in court and urged their supporters to avoid bloodshed at all costs.
After the 2007 voting disaster, the government set up an ambitious new constitution, making this election one of the nation's most complicated polls since the country gained independence from Britain in 1963.
It also revamped various political systems, including the electoral process and the judicial system.
But analysts say the real test will come after the results are announced: Will the loser bow out gracefully to avoid stoking tensions?
Millions cast ballots
About 70% of the 14.3 million eligible voters voted this week, according to election officials. Eight contenders are vying for the presidency.
The winner must secure more than 50% of the vote to avoid a runoff tentatively scheduled for next month.