Poland's lower house of parliament on Friday passed controversial judicial reforms, which the governing conservatives say are necessary to avoid chaos but the opposition calls a threat to the rule of law.
The vote, with 233 votes in favor, 205 against and 10 abstentions, came just a few hours after the European Commission called on Warsaw to put off on approving the draft law.
What will the law do?
The bill was prepared by the governing right-wing Law and Justice (PiS) party in response to rulings by the European Court of Justice and the Polish Supreme Court, which called into question various judicial reforms introduced by the conservatives.
The ruling party slightly watered down its proposals, by removing from the bill rules that would require judges to reveal the names of social media accounts they use under pseudonyms.
Read more:
Could Poland leave the EU over dispute?
The legislation will still allow the punishment of judges who question their peers' legal status or the validity of other courts, for example, by cutting their salaries or dismissing them.
Justice Minister Zbigniew Ziobro on Thursday said the bill "protects and restores a normal state of affairs in Poland's justice system."
What did the EU say?
The bill has triggered street protests across Poland and critics say it would put judicial independence at risk.
A few hours before the vote, European Commission Vice-President Vera Jourova warned Polish authorities over the bill, urging Warsaw not to breach European legal norms.
She called on Poland to first consult the Council of Europe's Venice Commission – which advises countries on bringing their laws into line with EU requirements – about the proposed legislation.
The Supreme Court on Tuesday warned the proposed rules would "very likely" lead to Poland being punished by the EU for failing to respect its treaty commitments. If the government refused to back down, the country could eventually have to leave the bloc, it added.
The legislation will now be discussed in the Senate, which has been controlled by anti-PiS parties. The opposition can delay the legislation, but has no power to derail it, experts told Reuters.
(With input from agencies)