Nigeria elections
Muhammadu Buhari's people claim he has beaten Goodluck Jonathan in the Nigeria electionsGetty

Nigeria's presidential challenger Muhammadu Buhari has claimed victory in the country's the closely fought elections.

With vote counting is still ongoing, a spokesman claimed the retired military general and former dictator has succeeded in beating incumbent president Goodluck Jonathan at the ballots.

"As for the election, we have won it," Garba Shehu told the Associated Press. "We are not out of the woods yet, we don't know what tricks the government is going to play."

The US and Britain had previously warned there were "disturbing indications" of political meddling with the vote count.

Lai Mohammed, another spokesman for Buhari's All Progressives Congress (APC) party told AFP: "This is the first time the opposition has voted a government out of power in Nigeria's history."

Earlier, partial results indicated Buhari, a Muslim from the north, was leading with a consistent margin on Jonathan, a Christian from the south.

With just a handful of states still to declare, the 72-year-old former military ruler who had previously run for the top job three times and been defeated, was reportedly ahead by some three million votes.

Buhari was the head of a military junta that ruled Nigeria for almost two years in the 1980s after deposing a civilian government.

The 2015 election has been described as the tightest presidential race ever in the 54-year post-independence history of the Western African nation. The results will be crucial in Africa's most populous nation's fight against Boko Haram's Islamist insurgency.

The group is fighting to turn Nigeria, whose people are almost equally divided between Christians in the south and Muslims in the north, into an Islamic state where Shariah law is applied.