WARSAW (Reuters) - Poland’s ruling Law and Justice party (PiS) rushed a legislative amendment through parliament on Wednesday reversing changes it had made at the Supreme Court that the European Union had condemned as undemocratic.

FILE PHOTO: Poland's Minister of Justice Zbigniew Ziobro attends a government meeting in Warsaw, Poland July 25, 2017. REUTERS/Kacper Pempel

The European Court of Justice in October ordered Poland to suspend the judicial overhaul which had forced many judges to retire, effectively enabling PiS to select their replacements, one of several steps by Warsaw that the EU said weakened the rule of law.

“We are fulfilling our obligations,” Justice Minister Zbigniew Ziobro told parliament. “At the same time, we are pushing forwards with our changes in the justice system.”

Since its implementation, more than 20 Supreme Court judges — around one-third of the total — have been forced to quit. Under Wednesday’s amendment, judges who were retired can return to work.

Since winning power in 2015, PiS has enjoyed strong public backing, despite criticism over its democratic record, benefiting from strong economic growth, generous welfare spending and nationalist rhetoric.

But this week, an opinion poll appeared to show that popularity had been dented by a corruption scandal.

The Kantar Millward Brown poll published late on Tuesday showed support for PiS fell by five percentage points to 33 percent. It rose for the opposition Civic Platform by the same amount to 26 percent, private broadcaster TVN said.

PiS is struggling to contain repercussions for the banking sector from the scandal in which an owner of a mid-tier lender accused the head of financial regulator KNF of asking him to pay millions of dollars to a lawyer in exchange for “support” for his struggling bank.

Marek Chrzanowski, the KNF chief appointed by PiS, denies wrongdoing.

Opposition groups have called for a parliamentary inquiry, although PiS has said probes by prosecutors and anti-corruption officials should be enough. Fifty-eight percent of Poles want an independent investigation, according to the Kantar poll.

One opposition politician accused PiS of trying to divert public attention by unexpectedly scheduling the legislative amendment vote on Wednesday.

“One may say better late then never, but don’t count your chickens before they hatch. PiS is doing this deliberately to hide the scandal with regulator KNF,” Joanna Scheuring-Wielgus, a liberal lawmaker, said.

The European Commission, which took Poland to the EU court, did not immediately respond to a request for comment.