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.
Al Jazeera's Yvonne Ndege, reporting from the capital Abuja, said Buhari was declared the winner after he gained 2.7 million more votes than his rival, incumbent President Goodluck Jonathan.
Our correspondent said that Buhari managed to secure more than 25 percent of votes in 24 states, ruling out a run-off vote.
To win the election, Buhari had needed more than 50 percent of the total votes nationally - and take at least 25 percent of the vote in two thirds of the states.
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.