Vote counting is underway 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.
The results are being counted at tens of thousands of polling stations, and 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.
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 in Lagos.
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 said.
There have been also been reports of violence and ballot boxes being snatched in Lagos, Nigeria’s biggest city.
In the north-eastern state of Borno, Mr Yakubu said that militant Islamists had opened fire on electoral officers from a mountaintop 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 for 109 federal senators and 360 members of the house of representatives, with another vote for state governors in March.
The election has seen a huge interest from young people – a third of eligible voters are below 35.
Mr Obi, 61, is hoping to break up Nigeria’s two-party system after joining the Labour Party last May.
Although he was in the PDP before then, he is seen as a relatively fresh face and enjoys fervent support among some sections of Nigeria’s youth, especially in the south.
The wealthy businessman served as governor of the south-eastern Anambra State from 2006 to 2014. His backers, known as the “OBIdients”, say he is the only candidate with integrity, but his critics argue that a vote for him is wasted as he is unlikely to win.
Instead, the PDP, which ruled until 2015, wants Nigerians to vote for Mr Abubakar, 76 – the only major candidate from the country’s mainly Muslim north.
He has run for the presidency five times before – all of which he has lost. He has been dogged by accusations of corruption and cronyism, which he denies.
Most of his career has been spent in the corridors of power, having worked as a top civil servant, vice-president and a prominent businessman.
Most people consider the election a referendum on the APC, which has overseen a period of economic hardship and worsening insecurity.
Its candidate, Mr Tinubu, 70, is credited with building Nigeria’s commercial hub Lagos, during his two terms as governor until 2007.
He is known as a political godfather in the south-west region, where he wields huge influence, but like Mr Abubakar, has also been dogged by allegations of corruption over the years and poor health, both of which he denies.
A candidate needs to have the most votes and 25% of ballots cast in two-thirds of Nigeria’s 36 states to be declared the winner.
Otherwise, there will be a run-off within 21 days – a first in Nigeria’s history.