Poland's president signed legislation Monday that reinstates Supreme Court judges who were forced into early retirement despite the European Union condemning the removals as a violation of democratic standards.

Earlier in the day, the EU's top court, the European Court of Justice, ruled that Poland needed to suspend a law that lowered the retirement age for Supreme Court judges and to put about two dozen justices the law had affected back on the bench.

President Andrzej Duda signed the revisions that removed the early retirement provisions, presidential aide Pawel Mucha said late Monday. The quick response comes amid a broader push by Poland's conservative ruling party, Law and Justice, to ease tensions with the EU.

Monday's ruling confirmed the Court of Justice's interim judgment from October ordering Poland to reinstate justices who were forced to step down when the retirement age was lowered from 70 to 65. The European Commission, which enforces EU law in member countries, had asked the court to review Poland's law.

The commission viewed the forced retirements of the judges as erosions of judicial independence and democratic standards because it gave the legislative and executive branches of government unprecedented control over the courts.

After the interim injunction, Poland's parliament passed the amended legislation to remove the early retirement provisions.

Critics of the government welcomed the backtracking on the issue of the retirement age but argued more must be done to undo what they see as extensive damage to judicial independence under the Law and Justice.

They say the ruling party's overhaul of the judicial system included capturing control of the Constitutional Court and a council that names judges, as well as other steps that increase its sway over the Supreme Court.

Law and Justice came out of local elections this fall bruised in major cities, where many voters rejected the party's previous euroskeptic course. The EU is extremely popular among Poles, who have grown richer and gained unprecedented freedom to travel and to work abroad thanks to their country's EU membership.

The party has given signs it is embracing a comparatively moderate, EU-friendly program as it gears up for elections to the EU's European Parliament in the spring and to the national parliament in the fall.