Poland could have to leave the EU over its judicial reform proposals, the country's Supreme Court has warned.
The proposals would allow judges to be dismissed if they questioned the government's judicial reforms.
Judges say the proposals threaten the primacy of EU law and could be an attempt to gag the judiciary.
Poland has already been referred to the European Court of Justice (ECJ) regarding rules for judges.
Under the proposals put forward by the socially conservative Law and Justice party government, judges can be punished for engaging in "political activity".
Any judge that questioned the legitimacy of judges nominated by the National Council of the Judiciary could be handed a fine or in some cases dismissed.
Politicians will start discussing the proposals on Thursday.
The ruling party claims changes to the law are needed to tackle corruption and overhaul the judicial system, which it says is still haunted by the communist era. But the EU accused Law and Justice (PiS) of politicising the judiciary since it came to power in 2015.
The Supreme Court said the party was undermining the principle of the primacy of EU law over national law. It said in a statement: "Contradictions between Polish and EU law.... will in all likelihood lead to an intervention by EU institutions regarding an infringement of EU treaties, and in the longer run [will lead to] the need to leave the European Union."
It also said the proposed bill was "evidently" designed to allow President Andrzej Duda to pick a new head of the court before a presidential election which is expected in May.
The court's chief justice, Professor Malgorzata Gersdorf, likened the governing party's proposals to the days of martial law in 1981 in communist Poland.
"I would therefore ask that the hatred of judges and courts stops being used as a weapon in the struggle for power, especially since repression, as in 1981, would be a sad expression of powerlessness rather than a manifestation of strength," she wrote in a statement on the court's website.
Polish judges are nominated by the National Judicial Council (NCJ), a body that is supposed to safeguard the independence of the judiciary, and which until recently consisted of a majority of judges selected by their peers.
However, in 2018 the ruling party changed the law so that the majority of judges sitting on the NCJ were appointed by the lower house of parliament, which is controlled by PiS.
Poland's NCJ had its membership of the European Network of Councils for the Judiciary suspended on the grounds it was no longer politically independent.
Earlier this month, Poland saw thousands of people protest in cities and towns to show solidarity with judges who they said were facing intimidation. They called for the reinstatement of one judge, Pawel Juszczyszyn, who was dismissed from his post for questioning the appointment of another judge by the NCJ.