Nigeria's opposition All Progressives Congress (APC) has declared an election victory for former military ruler Muhammadu Buhari and said Africa's most populous nation was witnessing history with its first democratic transfer of power.

"The people of Nigeria have taken over," ecstatic APC spokesman Lai Mohammed said from the house in the capital where Mr Buhari was watching the results on television.

The count showed Mr Buhari steamrolling to a landslide against President Goodluck Jonathan, whose People's Democratic Party (PDP) has made no comment since the scale of the political earthquake in Nigeria -- Africa's biggest economy and top oil producer -- has become apparent.

With just one of 36 states left to declare, Mr Buhari's APC had 15.1 million votes versus 11.7million for Mr Jonathan and the PDP.

Mr Mohammed said there was no reason to doubt Mr Jonathan would concede, in line with a peace accord he signed with Mr Buhari before this weekend's vote to allay fears of violence.

Around 800 people were killed in three days of bloodletting in the mainly Muslim north after a Buhari defeat to Jonathan in 2011.

Mr Buhari ruled from 1983 to 1985 before being ousted in another military takeover led by General Ibrahim Babangida. He has since declared himself a convert to democracy and has run and lost in several previous elections.

Mr Jonathan's five years at the helm have been plagued by corruption scandals and a Boko Haram Islamist insurgency in the north-east in which thousands have been killed. The PDP has run Nigeria since the end of military rule in 1999.

Bar some technical glitches and the killing of more than a dozen voters by Boko Haram militants, 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 business consultant with high-level contacts in Nigeria.

In the Abuja house where Buhari was staying, there was restrained joy tinged with a sense of the responsibility ahead, in particular managing a smooth transition in a country of 170 million people split along a complex mix of ethnic, religious and regional lines.

"We should all work together to redirect the country. A lot of sacrifices will have to be made," Kwara state senator and senior APC official Bukola Saraki said.

In a sign of the simmering PDP passions, Mr Buhari's march to victory was briefly interrupted when Godsday Orubebe, a former minister from the Niger Delta, grabbed a microphone and launched into a 10-minute rant against election commissioner Attahiru Jega at the body's headquarters in Abuja.

"Mr Chairman, we have lost confidence in what you are doing," he shouted. "You are being very, very selective. You are partial."

Mr Orubebe was finally persuaded to end his sit-in and put down the microphone, allowing the results ceremony to continue.

At least 15 people were shot dead on polling day, most of them in the north-east where Boko Haram has declared war on democracy in its fight to revive a mediaeval caliphate in the sands of the southern Sahara.

However, the level of violence and chaos was significantly lower than previous elections in a country that only rid itself of military rule 16 years ago.

As Mr Buhari's vote tally mounted, flashpoint northern cities such as Kaduna and Kano were quiet.