Vote counting is under way in Nigeria’s tightest presidential election since military rule ended in 1999.
Voting was marred by long delays as polling stations failed to open on time in some areas because of logistical problems and security incidents.
Turnout appeared to be high, with many young, first-time voters arriving before dawn to cast their ballots.
The elections are the biggest democratic exercise in Africa, with 87 million people eligible to vote.
Politics has been dominated by two parties – the ruling APC and the PDP – since the restoration of multi-party democracy 24 years ago.
But this time, there is also a strong challenge from a third-party candidate in the race to succeed President Muhammadu Buhari – the Labour Party’s Peter Obi, who is backed by many young people.
Tens of thousands of polling stations are counting the results, which will be collated and sent to the electoral headquarters in the capital Abuja.
The final result is not expected until at least Tuesday.
At a press briefing, the electoral chief, Mahmood Yakubu, apologised for the delays in voting, but he said that everyone who was in a queue by 13:30 GMT (14:30 local time) would be allowed to cast their ballots, even though polling stations were officially supposed to close by then.
Voters in the biggest city, Lagos, cheered as electoral officers arrived at a polling station in the suburb of Lekki nearly four hours after polls had officially closed.
There have also been reports of violence and ballot boxes being snatched in Lagos.
Although some voters were angry at the delays, others waited patiently to vote.
“As a Nigerian you expect any eventuality, so I came out with my power bank and a bottle of water. I will wait till they arrive so I can vote,” first-time voter Edith told the BBC.
Mr Yakubu said that armed men had attacked some polling units in the southern state of Delta and the northern state of Katsina, where voter card verification machines were carted away.
They were subsequently replaced and security boosted to allow voting to take place, he added.
But voting was postponed to Sunday at 141 polling stations in the oil-rich southern state of Bayelsa because of disruptions.
In the north-eastern state of Borno, Mr Yakubu said that militant Islamists had opened fire on electoral officers from a mountain top in the Gwoza area, injuring a number of officials.
The lead-up to the polls was overshadowed by a cash shortage caused by a botched attempt to redesign the currency, leading to widespread chaos at banks and cash machines as desperate people sought access to their money.
The new notes were introduced in order to tackle inflation, and also vote-buying. On the eve of the election a member of the House of Representatives was arrested with almost $500,000 (£419,000) in cash, and a list of people he was supposed to give it to, police say.
Whoever wins will have to deal with the currency redesign, a crumbling economy, high youth unemployment, and widespread insecurity which saw 10,000 killed last year.
Voters also cast their ballots for 109 federal senators and 360 members of the house of representatives, with another vote for state governors in March.