Nigeria on Sunday awaited results from its presidential election, as civil society groups warned that disorganisation and violence may have undermined the polls.
Results from Saturday's vote were expected to trickle in to Abuja after being collated at the state and local levels.
Mahmood Yakubu, chairman of the INEC election commission, will officially declare the outcome in the coming days. But both sides have already claimed victory.
President Buhari's aide Bashir Ahmad described the incoming results as "so overwhelming". "PMB (President Muhammadu Buhari) has been voted by majority and #BuhariIsWinning!" he tweeted.
His main opponent's media team said INEC should "immediately announce results as delivered from the polling units and declare the people's candidate, Atiku Abubakar, the winner".
Mr Yakubu, however, told reporters: "Only the Independent National Electoral Commission can tally figures, announce results and declare winners."
Whoever becomes the next leader of Africa's most populous country and leading oil producer faces a daunting to-do list, from tackling widespread insecurity and endemic corruption to boosting an economy recovering from months of recession.
INEC said it was "generally satisfied" with the vote, even though polling stretched into Saturday evening in areas where voter card machines failed and materials were late arriving.
Some affected polling units in six of Nigeria's 36 states and the Federal Capital Territory of Abuja even saw voting on Sunday.
A coalition of more than 70 civil society groups which are monitoring the vote reported 16 deaths from election-linked violence in eight states. Others gave a higher toll.
Nigeria's last election in 2015 was widely seen as the freest and fairest since the country returned to democracy in 1999 after decades of military rule.
But Idayat Hassan, of the Centre for Democracy and Development (CDD) in the capital Abuja, said this year's bloodshed and malfunctions were a setback.
"This election was a serious deterioration from 2015," she told AFP. "What we now expect from a credible, free and fair election was not there."
Despite both sides' bullishness, it was difficult to assess from unofficial results announced at individual polling units who was in front.
But there were snapshots of each candidate's performance: Mr Abubakar, for example, failed to win the polling station where he voted in Yola, capital of his home state Adamawa.
Mr Buhari personally cast a ballot in his hometown of Daura in the northwest state of Katsina, but lost the polling unit set up at the presidential villa in the capital, Abuja.
The election was originally set for February 16 but INEC announced a week-long delay just hours before polling was due to begin, angering voters who had already travelled home to participate.
The delay saw the main parties accuse each other of conspiring with INEC to rig the result, although neither has produced evidence.
Hours before voting began, Boko Haram's Islamic State-backed faction launched a rocket attack on the northeastern city of Maiduguri that killed one soldier.
In Rivers state, in the oil-rich southern Niger Delta region, the army said soldiers killed six "hoodlums" in clashes.
Mr Yakubu said one election volunteer was killed by a stray bullet in Rivers, where some INEC staff and even police were held hostage. They were all released unharmed, he added.
Other election staff were attacked in the southern state of Akwa Ibom and Kogi in the north central region.
There were reports of ballot-snatching, vote-buying and violence elsewhere, including in the southwestern state of Lagos.
Abiodun Baiyewu, director of Global Rights Nigeria, a civil society group monitoring the vote, said INEC and the security forces could have done more to ensure voters' safety.
"INEC needed to have a communication plan with security but we found that this was lacking and security was ineffective," he added.
A total of 72.7 million people with voter identity cards were eligible to vote in Saturday's polls. Parliamentary elections were held at the same time.
In 2015, former military ruler Buhari became the first opposition candidate in Nigerian history to defeat a sitting president, beating Goodluck Jonathan by 2.5 million votes.
Mr Buhari has again vowed to be tough on insecurity and corruption, and wants to complete much-needed infrastructure projects.
Abubakar is a pro-business free marketeer whose main pledges have been to privatise giant state-run companies and float the embattled naira currency.
Nigerian elections have previously been characterised by voting along ethnic and religious lines.
But with Mr Buhari and Mr Abubakar both northern Muslims, that could split the northern vote, making southern states a key battleground.