Challenger Muhammadu Buhari won Nigeria's presidential election by 2.57 million votes, official results showed on Wednesday, defeating incumbent Goodluck Jonathan in the first democratic change of power 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 72-year-old former army general Buhari, who led a tough military regime in the 1980s but now describes himself as a "converted democrat".

Thousands spilled onto the streets of northern Nigeria's biggest city, Kano, in celebration, shouting campaign slogan "Sai Buhari" ("Only Buhari") as he took an unassailable lead with one state to declare. Many brandished brooms, Buhari's party symbol, with which they have pledged to sweep away years of government waste and corruption.

In another northern city of Kaduna -- the scene of rioting after the 2011 presidential election -- supporters of his All Progressives Congress (APC) chanted: "Change! Change!" The Independent National Electoral Commission (INEC) said Buhari won 15,424,921 votes, or 53.95 percent, of the 28,587,564 total valid ballots cast. Rival Jonathan, 57, of the Peoples Democratic Party (PDP), won 12,853,162 votes (44.96%) in the election held Saturday and Sunday.

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."

The election was hit by glitches in new voter technology and claims of irregularities, after being delayed by six weeks due to concerns of attacks by Boko Haram insurgents. But with dissatisfaction rife over Nigeria's security, corruption and the economy faltering 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.