Nigeria's President Muhammadu Buhari has said the criticism he has received from the EU, UK and the US over the suspension of the chief justice is based on rash and uninformed opinion.
Linking the removal of Judge Walter Onnoghen to the election was "illogical", his spokesman said.
Justice Onnoghen is facing charges over allegedly failing to declare his personal assets before taking office.
Nigeria's presidential and legislative elections will be held on 16 February.
The EU, UK and US have criticised the suspension of Justice Onnoghen , who took office in 2017, suggesting it could "cast a pall over the electoral process".
The Nigerian government reacted to the comment saying its "friends" had acted in "haste" and did not have a deeper understanding of the situation.
Atiku Abubakar - the main challenger to Mr Buhari in the presidential election - called Justice Onnoghen's suspension "an act of dictatorship".
Justice Onnoghen's refusal to step down voluntarily forced the president to act, presidential spokesman Garba Shehu said.
"To link the [chief justice] to the elections in this way is illogical unless they assume that election complaints will be filed and go all the way to the Supreme Court," Mr Shehu added.
"The [chief justice] does not run the election. Nor is he the first arbiter of any electoral complaints."
The suspension was temporary until the conclusion of the case being heard by a Code of Conduct Tribunal, he said.
He said that the none of the western countries would allow a person, "enmeshed in legal uncertainty to preside over your legal systems until the cloud has been cleared from him".
Opposition politicians have halted campaigning in protest at the president's decision to suspend Mr Onnoghen.
President Buhari, who is seeking a second term, has often accused the judiciary of frustrating his anti-corruption fight.
On Friday, the president defended the suspension a series of more than 30 tweets.
He said that the judge should have stepped aside when the allegations reached court.
"Instead, the nation has been treated to the sordid spectacle of a judicial game of wits," he tweeted, "in which the Chief Justice of Nigeria and his legal team have made nonsense of the efforts of the Code of Conduct Tribunal."
The new chief justice, Ibrahim Tanko Mohammed, was sworn in on Friday.
Why the international pressure?
As the head of the judiciary, Nigeria's chief justice plays a vital role in settling election disputes.
The charges against the top judge and his subsequent suspension just before elections have been seen by some as politically motivated.
The suspension came less than 24 hours before Mr Onnoghen was scheduled to swear in members of election tribunals.
"The decision to suspend the chief justice has led to many Nigerians, including lawyers and civil society observer groups, to question whether due process was followed," said the EU Election Observation Mission in a statement.
The US embassy said it was "deeply concerned" at the decision to replace Justice Onnoghen "without the support of the legislative branch on the eve of national and state elections".
The British High Commission also expressed "serious concern over the suspension". In a statement it said: "It risks affecting both domestic and international perceptions on the credibility of the forthcoming elections."
Read also: Nigeria president 'sacks' acting chief judge