Nigerian election winner Muhammadu Buhari congratulated outgoing President Goodluck Jonathan for peacefully relinquishing power on Wednesday, a day after becoming the first Nigerian politician to unseat a sitting leader at the ballot box.

"President Jonathan was a worthy opponent and I extend the hand of fellowship to him," Buhari told journalists and supporters to loud applause.

"We have proven to the world that we are people who have embraced democracy. We have put one-party state behind us."

The presidential election, a vote punctuated by sporadic violence and technical glitches, nonetheless represented the first democratic transfer of power in the oil-rich African nation.

Nigeria's election commission confirmed the outcome in favor of the former army general Buhari late Tuesday, after nearly all votes had been tallied in a delayed count.

The margin of victory — Buhari got 15.4 million votes to Jonathan's 13.3 million — was enough to prevent any legal challenge. "You voted for change and now change has come," Buhari said.

The rules state Jonathan must officially hand over power on May 29.

Buhari's party, the All Progressives Congress (APC), had earlier declared victory for its candidate, with a spokesman stating that the country was “witnessing history.”

“This is the first time in Nigeria that a sitting government will be voted out of power using purely democratic means,” APC spokesman Lai Mohammed told Reuters at the house in the capital where Buhari watched the results come in. “The people of Nigeria have taken over.”

President Goodluck Jonathan conceded defeat in a phone call to his now successor, according to both the APC and a Nigerian Cabinet member.

“President Jonathan called General Muhammadu Buhari, the winner of the elections, to congratulate him,” Mohammed said, adding, ”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.”

Such a move will allay fears that a contested result could spark the kind of violence witnessed at the last general election, in which hundreds of people were killed.

Former army general Buhari ruled Nigeria from 1983 to 1985 after seizing power in a coup. Ousted himself in another military takeover led by General Ibrahim Babangida in August 1985, he declared himself a convert to democracy and has since run and lost in several previous elections.

Jonathan's five years at the helm of Africa's most populous country and biggest economy have been plagued by corruption scandals and a Boko Haram insurgency. His People's Democratic Party (PDP) has run Nigeria since the end of military rule in 1999.

At least 15 people were shot dead on polling day, most of them in the northeast where Boko Haram is attempting to carve out its own state.

However, the level of violence and chaos was significantly lower than previous elections in the country of 170 million. The election has been the smoothest and most orderly in recent history — a factor that appears to have played in the outcome.

“There are probably lots of reasons why the PDP might have lost, but I think the key one is that the elections just haven't been rigged,” said Antony Goldman, a consultant with high-level contacts in Nigeria.

“If you leave it to the Nigerian people they will be ready to make big decisions and to make Nigeria look something more like a conventional democracy.”

The relatively orderly conduct also eased fears of a repeat of the violence that followed Buhari's loss to Jonathan in 2011, when 800 people were killed in three days of bloodletting in the predominantly Muslim north.

Although Nigeria's economy has been growing at 7 percent or more, scandals over billions of dollars in missing oil receipts and the violence of Boko Haram in which thousands have died undermined Jonathan's popularity.

The president's perceived slow reaction to the kidnapping of more than 200 schoolgirls from the village of Chibok in April last year by Boko Haram also caused widespread anger.

Buhari, a Muslim northerner, campaigned on his reputation as a military strongman who could crush Boko Haram.

The war has turned in Jonathan's favor in the past six weeks. The Boko Haram fighters controlled an area the size of Belgium at the start of the year, but a string of military victories by troops from Nigeria, Chad, Cameroon and Niger has reclaimed much of the territory. But that progress appears to have been too late for him.

Al Jazeera and Reuters