Ruling party candidate Bola Tinubu has been declared the winner of Nigeria's disputed presidential election.
The 70-year-old veteran politician got 37% of the vote, official results show.
His main rival Atiku Abubakar polled 29%, and Labour's Peter Obi 25%. Their parties had earlier dismissed the poll as a sham, and demanded a rerun.
Mr Tinubu is one of Nigeria's richest politicians, and based his campaign on his record of rebuilding the biggest city, Lagos, when he was governor.
He was nevertheless defeated in the city by Mr Obi, a relative newcomer who mobilised the support of many young people, especially in urban areas, shaking up the country's two-party system.
Mr Tinubu won most other states in his home region of the south-west, where he is known as a "political godfather" - for helping to put others into office.
He campaigned for the presidency under the slogan: "Emi lo kan", which means "It's my turn" in Yoruba.
In his acceptance speech, Mr Tinubu called for reconciliation.
- ED heads for Marange
- ‘Zimbos dreading 2023 elections’
- Zim headed for a political dead heat in 2023
- Your Excellency, the buck stops with you
Keep Reading
"I take this opportunity to appeal to my fellow contestants to let us team up together. It is the only nation we have. It is one country and we must build it together," he said in a televised speech.
He added that they had the right to challenge the results in court but said that the lapses in the election "were relatively few in number and were immaterial to affect the outcome of this election".
According to official results, voter turnout was 27%, one of the lowest since the end of military rule in 1999.
With about 8.8 million votes cast for Mr Tinubu, he was the choice of less than 10% of the record 93 million Nigerians who registered to vote, helped by a divided opposition.
A newly introduced electronic voting system seems to have eliminated the ballot-stuffing that happened in the past and helped present a more accurate picture of the voting population.
But given that 87 million people actually collected their voter cards before election day - which was not an easy process and involved queuing for hours - it is more likely that problems on voting day, rather than voter apathy, was responsible for the low number of ballots cast.
Many potential voters left polling stations without casting their ballots after voting did not start on time in many places.
In some opposition strongholds, voting did not take place at all and there were also cases of ballot-box snatching and voter intimidation in southern states such as Rivers, Lagos and Delta.
President Muhammadu Buhari is stepping down after two terms in office, marked by economic stagnation and growing insecurity around the country - from an Islamist insurgency in the north-east to a nationwide crisis of kidnapping for ransom and separatist attacks in the south-east.
Mr Tinubu now has the task of solving these problems, among others, in Africa's most populous nation and biggest oil exporter.
After fighting military rule in Nigeria, escaping into exile and being one of the founding members of the country's democracy in 1999, Mr Tinubu will feel that he was destined to become president.
He was always the favourite to replace Mr Buhari - whom he helped become president - and the hurdles he has surmounted to get here will make this an even sweeter win for him.
He was not expected to win the party primary, yet he won.
Many said his decision to go with another Muslim as a running mate would prove an obstacle, but it was not.
Previously all major parties have split their presidential tickets with a Christian from the south and a northern Muslim in order to achieve broad support across this vast nation of 210 million people.
He will now have to prove that he can hit the ground running and that he is still the same formidable force who built modern Lagos, Nigeria's commercial hub.
Mr Tinubu, known as "Jagaban" by supporters, will now be looking at unifying a country that is retreating into regional lines and religious blocs, as the election results show.
While he met the 25% requirement in two-thirds of Nigeria's 36 states to show he was nationally accepted, the nature of the win indicates the absence of a truly national party.
Mr Obi won in Christian-dominated states and former strongholds of the main opposition Peoples Democratic Party in the south, while the PDP support shrank back into its northern heartlands.