WARSAW, Poland (AP) — Poland’s senators have rejected a much-criticized bill that would give politicians the right to fire or fine judges.

The Senate’s vote on Friday can extend work on the legislation but not stop it from becoming law.

The vote in the upper house of parliament came a day after European legal experts said the proposed law violated European Union principles and would further undermine judicial independence in Poland.

Poland’s right-wing ruling party proposed the legislation, arguing it was needed to prevent “anarchy” among judges, some of whom are critical of the party’s policies.

The opposition has a slight majority in the Senate, but the Justice Ministry said it will work to get the lower house, which is controlled by the ruling Law and Justice party, to give the proposed law final approval.