Muhammadu Buhari was on Tuesday re-elected Nigeria's president, after a delayed poll that angered voters and raised political temperatures, leading to claims of rigging and collusion.
Buhari, 76, took an unassailable lead of more than four million votes with the last states yet to be declared, making it impossible for his nearest rival, Atiku Abubakar, to win.
The former military ruler was first elected as civilian president of Africa's most populous nation and leading oil producer in 2015.
Supporters of Buhari's All Progressives Congress (APC) had gathered to celebrate at his campaign headquarters in the capital, Abuja, even before the final results were announced.
Some sang "We're popping champagne!" while Vice-President Yemi Osinbajo was seen in a video clip singing "Up we go!" in a reference to Buhari and his "Next Level" campaign slogan.
Buhari's spokesman, Garba Shehu, posted a photograph of the president on Twitter, watching the results on television. "#BuhariHasWon," he wrote.
But there were none of the spontaneous street parties that marked his victory four years ago, when he became Nigeria's first opposition candidate to beat an incumbent president.
To win the presidency, a candidate needs a majority of votes nationwide and at least 25 percent of support in two-thirds of the 36 states and the Federal Capital Territory (FCT).
Initial results showed Buhari won 15 191 847 votes (56 percent) while Abubakar, of the Peoples Democratic Party (PDP) won 11 262 978 votes (41 percent).
Buhari won in 19 states - including the two most populous, Lagos and Kano - while Abubakar was victorious in 17 states and the FCT.
There was no immediate official concession from Abubakar, whose party had earlier called on the Independent National Electoral Commission to halt the count, citing irregularities.
In 2015, president Goodluck Jonathan won plaudits for conceding to Buhari in a phone call, when the results indicated he could not win.
The concession is acknowledged as having prevented a repeat of the political violence that has marked previous elections in Nigeria, in which hundreds of people have been killed.
This year's election - the sixth in the 20 years since the return of civilian rule after decades of military government - was initially scheduled for February 16.
But INEC postponed them for one week just hours before polls were due to open, citing logistical difficulties in delivering ballot boxes and other election materials.
Voting took place on Saturday after a week in which the APC and PDP intensified their war of words, accusing the other of conspiring with INEC to rig the result.
The PDP's claimed data from handheld devices used to authenticate voters' identities at nearly 120 000 polling units had been altered in favour of the ruling party.
It called for the results in at least two states to be re-run and for a reversal of the cancellation of tens of thousands of "valid, legal" votes elsewhere.
Observers also pointed out discrepancies in declared tallies.
The claims - and Abubakar's insistence that he would only accept a free, fair and credible election - could be a prelude to a legal challenge of the outcome.
The vote was marred by violence, including 53 deaths, according to the Situation Room, an umbrella group of more than 70 civil society groups that monitored polling.
Some observers reported instances of vote-buying, intimidation and violence towards voters and officials, which have been a problem in previous polls in Nigeria.
The issues will likely prompt calls for electoral reform, including the introduction of technology capable of directly transmitting results from polling units.
Several international monitors meanwhile said repeated postponements could undermine confidence in the electoral process, after similar delays in 2011 and 2015.
A total of 72.7 million people were eligible to vote in the presidential poll as well as parliamentary elections held at the same time.
Low voter turnout - in some places as low as 18 percent - was blamed on a combination of apathy because of the delay, organisational and logistical problems, as well as unrest.
But Nana Nwachukwu, a lawyer and political activist, said: "If people could see the effects (of voting) they would care more.
"You pump your own water, fuel your own electricity, transportation is private. That apathy is there because people don't rely on government."
Voter cards were also a cheap way of getting identification, she said, adding: "So, people collect them who have no intention of actually voting."AFP