Nigerian President Muhammadu Buhari looks set for re-election, results from Saturday's general election show.
With results in from most states, he has a lead of more than three million votes over his rival Atiku Abubakar.
Mr Abubakar's People's Democratic Party (PDP) has called for a halt in the count, alleging irregularities.
Delays and violence marred the run-up to the vote but no independent observer has said that there was electoral fraud.
Mr Buhari, a member of the governing All Progressives Congress (APC) party, is seeking a second term in office.
So far the APC has 19 states, while the PDP has 16 plus the capital Abuja. The candidate with the most votes is declared the winner as long as they have at least 25% of the votes in 24 or more of the 36 states.
Each party says the other is working with the Independent National Electoral Commission (Inec) to influence the vote, which was initially scheduled for 16 February but delayed for a week at the last minute.
Mr Buhari has promised to build on his accomplishments in office so far, while Mr Abubakar, a business tycoon, has accused the president of wasting his term.
Whoever wins in Africa's most populous nation and largest economy faces a range of problems including power shortages, corruption, security threats, and an economic slowdown.
The election commission is due to formally announce the winner on Wednesday.
What are the allegations?
PDP chair Uche Secondus has called the count "incorrect and unacceptable". On Tuesday the party said counting should be stopped, alleging data from voter card readers had been manipulated.
The federal government has accused the PDP of trying to "scuttle the polls" and prompt a constitutional crisis.
The African Union, the UN and regional bloc Ecowas have called on parties involved in the election to exercise restraint and await the full announcement of the results.
The initial vote was postponed early on 16 February, five hours before polls were due to open. Voters were also choosing members of the House of Representatives and Senate.
Most of the country was calm but there were reports of attacks by the Boko Haram Islamist militant group in the north, and voter intimidation and attempts to steal ballot boxes, especially in the southern states of Rivers, Lagos, and Anambra.
A coalition of civil society groups reported that a total of 16 people were killed around the country - fewer than in previous elections.
Two people were arrested in Lagos after a group of armed young men attacked voters, eyewitness Ralph Onodike told the BBC.
"What they were saying was that if you were not [voting for the ruling party] APC, you'll be attacked," he said.
What are the main issues?
Nigeria is Africa's largest oil producer but corruption and a failure to invest the proceeds from the industry have hampered development.
A slow recovery from a recession in 2016 means there are not enough jobs for the large number of young people joining the employment market. About a quarter of the working age population is unemployed.
Election in numbers
- 73 million have voters' cards
- 51% of the electorate under the age of 35
- 73 registered presidential candidates
- 120,000 polling stations
Mr Buhari has quelled a militant Islamist rebellion in Nigeria's north-east, but Boko Haram remains active. There has also been an upsurge in violence in the Middle Belt as traditional herders and more settled farmers have clashed.
Until 1999 Nigeria was governed by either short-lived civilian administrations or military rulers. But this year marks 20 years since the return of democracy.
Mr Buhari was elected in 2015 - the first time an opposition candidate had defeated an incumbent to become president.
Both Mr Buhari and Mr Abubakar are from the mainly Muslim north of the country and both are in their 70s, while more than half of Nigeria's 84 million registered voters are under 35.