The runner-up in Nigeria's presidential election has rejected the result as a "throwback to the jackboot era of military dictatorship".
Atiku Abubakar criticised what he called a "sham election" and has vowed to go to court.
President Muhammadu Buhari, who was re-elected in Saturday's poll, insisted that it had been free and fair.
Delays and violence marred the run-up to the election but no independent observer has cited electoral fraud.
In the 1980s, Mr Buhari, 76, was one of several military rulers in Nigeria and this election marks the 20th anniversary of the return to civilian rule.
Mr Buhari got 15.2 million votes while Mr Abubakar received 11.3 million.
Turnout was a record low at just 35.6% and Mr Abubakar, 72, said this was the result of a deliberate policy to prevent his supporters from voting.
He said that troops had been deployed to strongholds of his People's Democratic Party (PDP) to stop people casting their ballots.
Mr Abubakar said there had been "premeditated malpractices" in many states and wondered how states "ravaged" by the Islamist insurgency - in Mr Buhari's strongholds in the north - generated higher voter turnouts than more peaceful states.
"How can total votes in Akwa-Ibom, for instance, be 50% less than what they were in 2015?" he asked in his statement.
As he accepted his official certificate of election at the Independent National Electoral Commission (Inec) in the capital, Abuja, he said the election was "another milestone in Nigeria's democratic development" reports the AFP news agency.
"From the comment of several observers, both local and foreign, it is obvious that the elections were both free and fair," he said.
Earlier, he had urged his supporters not to "gloat or humiliate" the opposition following his victory.
"No section or group will feel left behind or left out," he promised.
A former soldier, Mr Buhari led a military regime for 20 months in the 1980s and was first elected president in 2015, becoming the first opposition candidate to defeat an incumbent and win the presidency.
His record in office is mixed. Mr Buhari's critics say that the very attributes that won over voters four years ago - his strictness and inflexibility - have emerged as liabilities. They accuse him of autocratic leanings as well as a disastrous tendency towards inaction.
Mr Buhari's supporters can argue that he has largely delivered on campaign pledges such as tackling corruption and cracking down on the Islamist militant group Boko Haram. But they may struggle to point to concrete achievements in other fields, such as fixing the economy.
By Fergal Keane, BBC Africa editor
The breadth and depth of corruption is so great, it affects so many aspects of public life that making serious inroads into the problem would require a focus, energy and application that was lacking in President Buhari's first term.
The second problem he faces in fighting corruption is having the necessary political support. There is undoubted public backing but Mr Buhari's party is compromised by senior members suspected of enriching themselves through graft. The fear is that across the board the looters will carry on pretty much as normal.
Economically, ending the dependency on oil revenues needs to happen at a much faster pace. The World Bank has predicted sluggish economic growth: 2.2% for the coming year in a country with unemployment of more than 20% and nearly half the population living in extreme poverty
President Buhari also faces an array of security threats from clashes between farmers and herdsmen in the Middle Belt, continuing instability in the Niger Delta and - most worrying of all - a revived threat from Islamic extremists in the north of the country.
Africa's most populous nation and largest economy faces a range of problems including power shortages, corruption, security threats, and an economic slowdown.
Nigeria is Africa's leading 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.
Civil society groups monitoring the election said at least 53 people were killed in political violence over the weekend.
Some 130 people have been taken into custody suspected of electoral offences, reports say.
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.