Nearly 90 million voters were eligible for Saturday's election, which went off mostly peacefully, although isolated violence, delays and technical hitches forced many to wait to nightfall to vote.
After two terms under President Muhammadu Buhari, many Nigerians hope a new leader can do a better job tackling the widespread insecurity, joblessness and growing poverty afflicting their nation.
The election pits former Lagos governor and APC candidate Bola Tinubu, 70, against old rival, former vice president and PDP candidate Atiku Abubakar, who at 76 is on his sixth bid for the nation's top job.
But for the first time since the end of military rule in 1999, a third-party candidate, Labour's Peter Obi, has challenged the APC and PDP dominance with a campaign message of change.
Crowds waited outside polling stations in Lagos and other cities late on Saturday as electoral officials tallied first results by hand and read out the counts before transmitting them to a central database.
"We just finished counting, but we need to make sure they upload the results," said Chizoba Onuoha, an IT manager, watching the count at her Lagos polling station.
The competitive three-way race has some analysts forecasting an unprecedented, second-round runoff between the two frontrunners if no candidate meets election requirements.
But for some voters, nightfall meant more waiting, after late starts by election officials and technical difficulties with voter ID technology created huge delays in some polling centres in Lagos and other cities.
In northwest Kano city, in one electoral area voting materials arrived five hours after official opening time, according to an AFP correspondent.
"Voting is still in progress well beyond the approved hours," said voter Kabiru Sani, 37. "We started late, and we will not allow ourselves to be disenfranchised."
In a country where votes are often marred by attacks, violent clashes between rival supporters, and ethnic tensions, Saturday's election was mostly peaceful.
Several Lagos polling booths were ransacked, according to the Independent National Electoral Commission or INEC, voter ID machines were stolen in other states and voting at 141 polling units in southern Bayelsa State would take place on Sunday after the ballot was disrupted.
Insecurity was a major election issue, with Nigeria still battling a 14-year jihadist insurgency in the northeast that has displaced two million people, bandit militias in the northwest and separatist gunmen in the southeast.
The success of Nigeria's vote will be closely watched in West Africa, where coups in Mali and Burkina Faso and growing Islamist militancy have taken the region's democracy back a step.
Buhari, a former army commander, steps down after two terms in office. His critics say he failed in his key promises to make Nigeria safer.
APC's candidate Tinubu, 70, a long-time political kingmaker and southern, says "It's my turn" for the presidency. He can count on APC's structure and his political network.
He faces a familiar rival -- PDP candidate Abubakar, 76, who is on his sixth bid for the top job and touts his business experience.
But both are old guard figures who have fought off past corruption accusations.
The emergence of a surprise third candidate appealing to young voters, Labour Party's Obi, 61, has thrown the race open with his campaign as the candidate of change.
Voters will also cast their ballot for Nigeria's two houses of parliament, the National Assembly and Senate.
To win the presidency, a candidate must get the most votes, but also win 25 percent in two-thirds of Nigeria's 36 states.
If no candidate wins, a runoff will take place within 21 days between two frontrunners.
The rules reflect a country almost equally split between the mostly Muslim north and predominantly Christian south, and with three main ethnic groups across the regions: Yoruba in the southwest, Hausa/Fulani in the north and Igbo in the southeast.
Nigeria's voting also often falls along ethnic and religious lines. This time, Tinubu is a southern Yoruba Muslim, Abubakar is an ethnic Fulani Muslim from the northeast and Obi is a Christian Igbo from the southeast.
Fuel and cash shortages caused by a bank note exchange in the run-up to the election also left many Nigerians struggling more than usual in a country already hit by more than 20-percent inflation.