Polish lawmakers have yielded to a ruling from the European Union’s top court, passing legislation that reverses a disputed Supreme Court retirement law. The law had raised fears in Brussels of a threat to Poland’s judicial independence.

Buckling under EU pressure, the governing right-wing Law and Justice (PiS) party used its majority to push the changes through parliament at high-speed after proposing them just hours earlier.

As reported by the Agence France-Presse (AFP), the motion passed with 215 in favour, 161 against and 24 abstentions in the 460-member lower house of parliament.

Presidential aide Andrzej Dera told Polish media on Wednesday that the unusually quick passage of the legislation was the result an “agreement by the government with the ECJ in order for Poland to avoid paying penalties.”

The disputed law had required more than a third of current Supreme Court judges to step down, including Poland’s Supreme Court chief justice Malgorzata Gersdorf. The European Court of Justice (ECJ) had ordered Poland in October to “immediately suspend” its decision to lower the retirement age of Supreme Court judges from 70 to 65.