Nigeria's President Muhammadu Buhari has suspended the country's top judge and replaced him with an acting chief justice weeks ahead of an election in which the judiciary could play an important role.

The main opposition candidate, Atiku Abubakar, on Friday called the president's decision "an act of dictatorship" and "the latest action in the ongoing rape of our nation's hard-earned democracy".

The suspended chief justice, Walter Onnoghen, is the head of Nigeria's judiciary that has helped resolve electoral disputes in past votes, some of which have been marred by violence and vote-rigging.

The chief justice could preside over a disputed election result.

190124062112272

Buhari, who was a military ruler in the 1980s and was voted into office in 2015, will seek a second term in an election scheduled on February 16.

At stake is control of Africa's top crude oil producer that has one of the continent's biggest economies.

Onnoghen has been asked to appear before a tribunal over allegations of breaching of asset-declaration rules, but has not responded to the charges and his lawyers say the tribunal does not have the authority to try him.

"With the directive of the CCT (Code of Conduct Tribunal) in a letter dated 23rd January, 2019, accordingly, I hereby suspend Hon Justice Walter Nkanu Samuel Onnoghen as the Chief Justice of Nigeria until the final determination of the case against him," Buhari said on Friday.

In reference to that directive, Buhari - in a message posted on Twitter - said it was an order by the CCT.

Tanko Mohammed, a judge from the northeastern state of Bauchi, is the acting replacement.

On Thursday, an appeal court had issued an interim order to halt charges being brought against Onnoghen.

Abubakar questioned why due process was not allowed to run its course and called for the international community to threaten "strong consequences" for anyone involved.

Civil society groups have also criticised the suspension.

Clement Nwankwo, executive director of the Abuja-based Policy and Legal Advocacy Centre, said Buhari had "violated the constitution".

"Unless the president has decided to operate a dictatorship, he really must rescind this so-called decision," said Nwankwo, who chairs the Situation Room, a group of more than 70 civic groups monitoring the electoral process.

He called on parliament to reconvene and review the decision.