World leaders have congratulated Muhammadu Buhari on his victory in Nigeria’s presidential election.
US President Barack Obama said the polls had “shown the world the strength” of Nigeria’s commitment to democracy.
UN Secretary General Ban Ki-moon said the way the polls had been conducted was “a testament” to Nigeria’s “democratic spirit”.
Gen Buhari beat outgoing President Goodluck Jonathan by 2.5 million votes.
Mr Buhari, of the All Progressives Congress (APC), became the first opposition candidate to win a presidential election in Nigeria.
Mr Jonathan, of the People’s Democratic Party’s (PDP), has congratulated Mr Buhari on his victory.
Mr Obama praised both Gen Buhari and Mr Jonathan for “their public commitments to non-violence throughout the campaign”.
He hailed the way Nigerians “came together to decide the future of their country peacefully”.
This is a hugely significant moment in Nigeria’s turbulent history. Never before has a sitting president been defeated in an election.
Since independence from Britain in 1960, there have been numerous coups and although the 2011 vote was an improvement, most elections have been rigged or even annulled by the military.
Of course in a relatively close election, there will be millions of people who are not pleased with the outcome. But the whole process is a sign that democracy is deepening in Nigeria and may be a tonic to other countries in Africa.
Nigerians can start to believe that it is possible to remove politicians through the ballot box.
Mr Ban commended Mr Jonathan for “his statesmanship in upholding the democratic process” and said “the successful conduct of these polls [was] a testament to the maturity of Nigeria’s democracy”.
More than 28 million Nigerians turned out to vote in the elections over the weekend. Gen Buhari beat Mr Jonathan by 15.4 million votes to 12.9 million.
Gen Buhari said it was time “to heal wounds”.
“Change has come,” he told supporters. “A new day and a new Nigeria are open to us. The victory is yours.
“Our country has now joined the community of nations that have used the ballot box to peacefully change an incumbent president in a free and fair election.”
He also praised Mr Jonathan as a “worthy opponent” who peacefully relinquished power.
Mr Jonathan said in a statement: “I promised the country free and fair elections. I have kept my word.”
He called on his supporters to stay calm, saying: “Nobody’s ambition is worth the blood of any Nigerian.”
Mr Jonathan’s spokesman Reuben Abati told the BBC the president would remain in office until the handover date of 29 May.
“He’s very proud of the fact that he’s been able to establish a tradition of free and fair and credible elections in Nigeria,” he said.
UK Foreign Secretary Philip Hammond said: “It is now important for both parties to ensure the transition to a new government remains peaceful.”
This election was the fourth time that Gen Buhari, 72, had contested presidential elections.
He gained much of his support in the north, in particular the north-east, which has suffered from Boko Haram’s six-year insurgency.
It has killed thousands of people in its drive to establish an Islamic state.
Many people accused Mr Jonathan of not taking Boko Haram seriously and thought Gen Buhari would be better positioned to defeat the militants.
The election was delayed by six weeks to allow the army enough time to recapture territory from Boko Haram.
The former military ruler won 94% of the vote in the worst-affected state, Borno