The European Union has launched unprecedented disciplinary measures against Poland, saying its judicial reforms threaten the rule of law.
It said 13 new laws in two years have allowed the government to "interfere significantly" in the judiciary.
Poland has been given three months to address the concerns.
In defiance of the EU move, President Andrzej Duda signed into law two bills reforming the Supreme Court and the National Council of the Judiciary.
Mr Duda said this would deepen democracy in Poland, improve the justice system and restore citizens' faith in the judiciary.
Poland's conservative government called the EU decision "political". It has repeatedly stated that the reforms are needed to curb inefficiency and corruption.
What is the EU saying?
After almost two years monitoring the situation in Poland, the European Commission - the EU executive - said this was a matter of "common concern" for the 28-member bloc.
At a meeting in Brussels, the Commission decided to launch disciplinary measures, called Article 7, and asked Warsaw to:
- Not apply lower retirement age to current judges
- Remove the discretionary power of the president to prolong the mandate of Supreme Court judges
- Remove the new retirement regime for judges including the discretionary powers of the Minister of Justice
- Restore the independence and legitimacy of the Constitutional Tribunal
The Commission's deputy head, First Vice-President Frans Timmermans, who had conducted talks with the Polish government led by the Law and Justice party (PiS), said there was "no other option" as the "entire structure was affected".
"After two years of trying for dialogue, of course we are frustrated that we haven't achieved what we want to, so now we're encouraging the council and Parliament to support us," he said.
All member states will now be asked to decide whether Poland is violating EU standards. Such a ruling needs the backing of 22 out of the 28 states.
Any possible sanctions would only come at a later stage. But Mr Timmermans said that Article 7 could be revoked if Poland addressed the points within the three-month period.
The sanctions could lead to the suspension of Poland's voting rights at EU summits.
But Hungary has said it would block such a move, known as the "nuclear option", that requires the approval of all member states.
The row underlines an escalation of tensions between western countries and eastern, former Communist countries within the EU, correspondents say. Other sensitive issues include media independence and immigration.
The system needs reforms, ordinary Poles say
By Adam Easton, BBC News, Warsaw
Poland's governing party says the judicial system needs deep reform because it is inefficient, slow and has never been "decommunised", in other words, communist-era judges and collaborators of that regime are still presiding over trials.
It is perhaps ironic then, that the party's point man on judicial reform, the PiS MP Stanislaw Piotrowicz, is a former communist-era prosecutor.
According to a recent opinion poll, 81% of Poles agree the court system needs reform. They were not asked whether they agreed with the party's solutions.
The public's main grievances in order of importance were that trials drag on far too long, the proceedings themselves are too complicated and corrupt judges. PiS says its reforms would re-establish public trust in the judiciary.
What is the Polish PM saying?
On Twitter Prime Minister Mateusz Morawiecki said the reform was deeply needed and that "Poland is as devoted to the rule of law as the rest of the EU".
He added: "The dialogue between the Commission and Warsaw needs to be both open and honest. I believe that Poland's sovereignty and the idea of United Europe can be reconciled."
Mr Morawiecki, who took office this month, has said that the EU has taken a one-sided view and that his country is entitled to carry out reforms. The proposals have sparked street protests.
Following the announcement, a spokesman for the prime minister said talks could resume in January.
British Prime Minister Theresa May, who is due to meet Mr Morawiecki at a summit in Warsaw on Thursday, will raise her concerns over the issue, a spokesman said.