Poland's Supreme Court warned the government on Tuesday that proposals for judicial reform would risk EU membership if they were enacted.
The proposals suggest judges could be removed for taking part in "activities of a political nature" or acting in a way that could "harm the functioning of the justice system".
Poland's Supreme Court building in Warsaw, Poland. Source: AAP
The court warned the plans appeared to be an attempt to force judges to apply all regulations even if they were "incompatible with higher legal norms", which would be a breach of EU rules.
The ruling Law and Justice party (PiS) insists the reforms will tackle corruption but the opposition says PiS wants to gag critical magistrates.
The Supreme Court said the rules, if adopted, 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 would have to leave the bloc, said the judges.
Jaroslaw Kaczynski, leader of the ruling Law and Justice party (PiS). Source: AAP
The European Court of Justice last month asked the Supreme Court to rule whether key parts of the reforms - a new judicial council and a disciplinary chamber - were free from political influence.
Poland's top court concluded that their independence was not guaranteed.
Campaign groups have called for mass protests on Wednesday in Warsaw and outside courts in dozens of other towns.
Danuta Przywara, who chairs the Polish branch of the Helsinki Foundation for Human Rights, said the law would mean "the end of the separation of powers and a return to the unitary power which we knew during Poland's communist era".