Former military ruler Muhammadu Buhari has become the first Nigerian to defeat a sitting president through the ballot box, putting him in charge of Africa's most populous nation and its biggest economy.
Buhari was declared the winner after he gained 2.7 million more votes than his rival, incumbent President Goodluck Jonathan.
Jonathan has publicly conceded defeat and conveyed his "best wishes" to the president-elect.
He urged his supporters to follow "due process" in channeling their frustrations at losing the election amid fear of violence.
"Nobody's ambition is worth the blood of any Nigerian," he said in a statement issued after his election defeat. "The unity, stability and progress of our dear country is more important than anything else."
The All Progressives Congress (APC) party earlier said that Buhari had received a phone call from incumbent Jonathan during which he immediately conceded defeat and congratulated him on his victory.
"There had always been this fear that he might not want to concede, but he will remain a hero for this move. The tension will go down dramatically," Lai Mohammed, spokesman for the APC, said.
Victory for Buhari marks the first time in Nigeria's history that an opposition party has democratically taken control of the country from the ruling party.