The EU's highest court ruled Tuesday that Hungary's reduced retirement age for judges constituted unjustified discrimination on the grounds of age, handing a victory to European Union officials who fear the country has begun a dangerous slide away from democratic principles.

The European Commission, the EU's executive branch, has taken issue with the actions of the current Hungarian government on a range of issues — including respect for the independence of the judiciary, ensuring the independence of the country's central bank, and protection of press freedom.

The Commission had questioned whether the sudden change in the mandatory retirement age of judges from 70 to 62 was part of an attempt to erode judicial independence. Hungarian officials had said the change was necessary to standardize the retirement age for public employees.

On Tuesday, the Court of Justice of the European Union rejected that argument, ruling that the measure is discriminatory. The court also said that judges had "a well-founded expectation" that they would be able to remain in office until they were 70, and the sudden change left them with no time to plan their retirements.

Hungarian officials said Tuesday the government "takes notice" of the ruling, adding that it related to regulations already struck down in July by Hungary's Constitutional Court.

"Otherwise, the government does not wish to comment on the decision," the Justice Ministry said in a statement.

In July, the Constitutional Court said in a narrow decision that the forced early retirement of judges was unconstitutional because it violated the principle that they cannot be removed, except in exceptional circumstances — one of the crucial guarantees of their independence.

Hungary joined the European Union in 2004, part of an expansion that increased the number of EU member states from 17 to 27. Concerns about whether the country is meeting the EU's democratic requirements have grown significantly since Prime Minister Viktor Orban and his right-wing Fidesz party swept into power in 2010. Orban and the party have used their two-thirds majority in parliament to radically change Hungary's political, economic and social landscape.

The EU and the United States have both expressed concerns that the country is not respecting civil liberties, and EU officials have on occasion summoned Orban to Brussels for talks on the issue.