Supporters of All Progressives Congress (APC) celebrate on March 31, 2015 in Lagos
Abuja (AFP) - Muhammadu Buhari on Tuesday became Nigeria's president elect after defeating Goodluck Jonathan in the first democratic change of power ever in Africa's most populous nation.
The victory writes a new chapter in the country's often turbulent history after six military coups since independence in 1960 and 16 years of unbroken civilian rule by Jonathan's party.
The gripping contest also capped a remarkable transformation for the 72-year-old former army general, who led a tough military regime in the 1980s but now describes himself as a "converted democrat".
Thousands spilled onto the streets of the north's biggest city, Kano, in celebration, shouting his campaign slogan "Sai Buhari" ("Only Buhari") as he took an unassailable lead with one state to declare.
Many brandished brooms, his party symbol, with which they have pledged to sweep away years of government waste and corruption.
In the northern city of Kaduna, supporters of his All Progressives Congress (APC) chanted: "Change! Change!"
Official results announced Wednesday showed Buhari winning by 2.57 million votes.
The Independent National Electoral Commission said Buhari won 15,424,921 votes or 53.95 percent of the 28,587,564 total valid votes cast.
His nearest rival, Jonathan, won 12,853,162 (44.96 percent.)
INEC chairman Attahiru Jega said: "Muhammadu Buhari, of the APC, having satisfied the requirement for the law and scored the highest number of votes is hereby declared the winner and is returned elected."
- Gripping contest -
The election was hit by glitches to new voter technology and claims of irregularities, having been played out against a backdrop of fears of deadly Boko Haram violence and poll-related clashes.
But with dissatisfaction over security, corruption and the faltering economy as oil revenues dived, voters turned out in force sensing an unprecedented opportunity for change.
In the financial hub of Lagos, in the southwest, Buhari supporters celebrated wildly, some of them on horseback, with fireworks exploding into the night
"This is the first democratic change ever in Nigeria," Anas Galadima told AFP, as thousands thronged the APC headquarters in the capital Abuja, dancing and banging drums.
"It's not about Muslim or Christian or any party. It's about politicians knowing that if you don't do the job, we can kick you out.
"I haven't been this excited since the night of Barack Obama's election."
- Dynamics changed -
Political commentator Chris Ngwodo said the victory had "instigated the supremacy and primacy of the electorate" in a country where elections had generally been a foregone conclusion for the incumbent.
"The dynamics between the governed and government has changed for good," said Ngwodo.
Buhari won because, backed by a strong and well-organised party machine, he had secured national support in a divided nation split between a largely Muslim north and mainly Christian south, he added.
Military gains against Boko Haram in recent weeks were welcomed but seen as too little, too late after so much bloodshed.
Jonathan conceded in a telephone call to Buhari at 5:15 pm even before the final results were declared, earning him praise from politicians of all stripes.
"I promised the country free and fair elections. I have kept my word," he said later, urging disputes over the results to be settled in court rather than on the street.
"Nobody's ambition is worth the blood of any Nigerian," he added.
- Key gains -
Buhari has accused Jonathan of a failure of leadership in tackling the Boko Haram insurgency, which over six years has left more than 13,000 people dead and some 1.5 million people homeless.
Borno state -- the region worst-affected by the Islamists' rampage and from where more than 200 schoolgirls were abducted in April last year to global outrage -- was last to declare.
Buhari won 94 percent of the vote, putting him 2.57 million votes ahead of Jonathan with the official tally awaited.
Hundreds of thousands of people defied threats of suicide attacks and bombings to vote, with polling stations set up in camps for displaced people from the conflict in the state capital, Maiduguri.
Buhari, a Muslim, won massively in the north and crucial gains elsewhere, including Lagos, which had been targeted by both sides as a swing state.
Jonathan, who at one point clawed back the deficit to some 500,000 votes after winning near total support in his home state of Bayelsa and neighbouring Rivers.
But it was not enough to seize back the momentum and with eight states to declare, most of them in the north, APC spokesman Lai Mohammed called victory.
"This is the first time the opposition has voted a government out of power in Nigeria's history," he told AFP.
- High expectations -
Buhari has admitted that he cannot perform miracles, with poverty widespread among Nigeria's 173 million people, the Boko Haram threat not yet over and the economy hit by the slump in global oil prices.
"Our expectation of getting there overnight is not realistic but... there are some of us in Nigeria who are serious" about stabilising the system, he said last month.
His wife, Aisha, said on Tuesday: "We are working towards a new Nigeria, as my husband promised. It's going to be tough. Expectations are high."
Buhari, with his military background, was seen as a better bet to fight the militants, while he has been seen as an anti-corruption crusader, despite excesses and abuses during his military rule.
He has vowed to lead by personal example, pledging: "Corruption will have no place and the corrupt will not be appointed to my administration."
But he has rejected PDP charges that he is unchanged from his days in the military, where he fell foul of rights groups in his pursuit of the corrupt and general "indiscipline".
"Before you is a former military ruler and a converted democrat who is ready to operate under democratic rules," he said in February.