ABUJA, Nigeria -- Nigeria's president on Friday suspended the country's chief justice just three weeks before the presidential election and a likely court challenge to the results, while the president's top rival called the move "an act of dictatorship."

The decision by President Muhammadu Buhari, who seeks a second term in the Feb. 16 vote, sent Africa's most populous country into a constitutional crisis. The Nigerian Bar Association called it an "attempted coup against the Nigerian judiciary" and Senate president Abubakar Bukola Saraki said Buhari cannot act alone in a process that involves all three arms of government.

Observers already have warned that the vote could lead to violence — Buhari's election in 2015 was a rare peaceful transfer of power in oil-rich Nigeria — and diplomats have urged the top candidates to sign a peace pledge.

The chief justice, Walter Nkanu Samuel Onnoghen, faces trial on charges of allegedly failing to declare his assets. Buhari said his suspension will continue until the case is concluded. This is the first time a chief justice is standing trial in Nigeria, where corruption is widespread. Onnoghen has argued that the charges lack merit.

Beyond the charges, "security agencies have since then traced other suspicious transactions running into millions of dollars" to Onnoghen's accounts, the president said in a statement.

Justice Ibrahim Tanko Muhammed will act as Nigeria's most senior judge, Buhari said. Muhammed, like the president, is from Nigeria's largely Muslim north while Onnoghen is from the largely Christian south.

Buhari's top election challenger, Atiku Abubakar, called the chief justice's suspension illegal. "This act of desperation is geared towards affecting the outcome of the 2019 presidential elections," he said in a statement.

Nigerians pointed out that the suspension occurred shortly before the chief justice was to swear in members of various election petition tribunals.

With tensions rising ahead of the vote, the United States and Britain issued statements on Thursday warning against election-related violence. The U.S. threatened "consequences," including visa restrictions, and Britain threatened to cut access to UK-based funds or even prosecution.

———

Umar reported from Maiduguri, Nigeria.

———

Follow Africa news at https://twitter.com/AP—Africa