By VANESSA GERA, Associated Press

WARSAW, Poland (AP) — The European Union's top court ruled Monday that a Polish law that pushed Supreme Court judges into early retirement violates EU law, a setback for Poland's right-wing government but a move welcomed by critics who worried the measure would cause a serious erosion of democratic standards.

In its ruling, the European Court of Justice said the measures breach judicial independence. An interim decision from the court in November ordered the Polish government to reinstate judges who were forced to retire early, about one-third of the Supreme Court's justices.

Poland's law "undermines the principle of the irremovability of judges, that principle being essential to their independence," the Luxembourg-based court said.

There was no immediate reaction from Poland's government, which the court also ordered in November to get rid of legal provisions that had required the judges to leave the bench.

Since the Law and Justice party came to power in 2015, Polish government authorities have increasingly taken control of the judicial system.

The government and president have said they wanted to force the early retirement of the Supreme Court judges as part of a larger effort to purge communist-era judges.

But legal experts say that argument holds no water because most communist-era judges are long gone from the judicial system 30 years after the fall of communism. Many critics believe the true aim is to destroy the independence of the Polish judiciary.

The biggest fear is that the judiciary could become so politicized that those not favored by the ruling authorities could be unfairly charged with crimes and sentenced, essentially deprived of fair hearings. Though a separate court, the Constitutional Tribunal, and other bodies are already under the ruling party's control, many judges have continued to show independence, ruling against the authorities, even the justice minister, in recent cases.

Amnesty International welcomed Monday's ruling, calling it significant for Poland and other EU countries "who think that they can breach human rights with impunity."

The human rights group alleged that "Polish authorities have continued to harass and discipline judges who they presumably considered to be unfavorable to their cause."

In Poland, critics of the government also welcomed the ruling.

"Thank you, European Union, for your defense of rule of law in Poland," tweeted Radek Sikorski, a former foreign minister.

Judge Bartlomiej Przymusinski, the spokesman for an association of Polish jurists, Iustitia, called the ruling "a ray of hope that the rights of citizens will be protected." However, he said judges still faced unwelcome attempts to influence their views and decisions, and praised those who have "not succumbed to political pressure."

The case, Commission v Poland, was brought by the European Commission, the branch of the EU that ensures the bloc's laws and values are respected.

"This is an important ruling in support of the independence of the judiciary in Poland and beyond," the commission said. "The rule of law is a founding pillar of our Union."