New York (CNN) President Donald Trump praised Poland for its independence at the United Nations General Assembly on Tuesday, a day after the European Commission decided to sue Warsaw for violating the independence of its judiciary.

"In Poland, a great people are standing up for their independence, their security, and their sovereignty," Trump said during his speech in New York. Trump made his remarks a week after saying that the US is considering placing a permanent military base in Poland and the country's president proposed naming it "Fort Trump" in his honor.

Trump's praise came a day after the EU referred Warsaw to the European Court of Justice over its government's apparent violation of its Supreme Court's judicial independence. It is the latest step that has widened the distance between Poland and the rest of Europe, as Warsaw's populist ruling Law and Justice Party has pursued policies that critics say undermine democracy.

The government has more than once stepped in to shape the country's courts, violating the constitution to do so in 2015. It has taken over the state broadcaster and fired journalists, and for a while, adopted a law that forbade blaming Poland for any crimes committed during the Holocaust.

Forced retirement

The EU is moving to sue Poland because of new laws the country passed that could force Supreme Court judges into retirement, the European Commission said Monday.

"Today, the European Commission decided to refer Poland to the Court of Justice of the EU due to the violations of the principle of judicial independence created by the new Polish Law on the Supreme Court, and to ask the Court of Justice to order interim measures until it has issued a judgment on the case," the Commission announced in statement on Monday.

The law, which came into force in on April 3, lowers the retirement age of Supreme Court judges from 70 to 65, putting 27 out of 72 sitting Supreme Court judges at risk of being forced to retire.

The European Commission, which is the politically independent executive branch of the EU, argues that the law is "incompatible with EU law as it undermines the principle of judicial independence," adding that its implementation could lead to "serious and irreparable damage" to the European Union's legal order.

'Their own unique visions'

Trump, speaking in New York, said that "many countries are pursuing their own unique visions, building their own hopeful futures, and chasing their own wonderful dreams of destiny, of legacy, and of a home. The whole world is richer, humanity is better, because of this beautiful constellation of nations, each very special, each very unique, and each shining brightly in its part of the world."

Trump packaged his praise for Poland alongside criticism for Germany for a pipeline project it is working on with Russia.

"Reliance on a single foreign supplier can leave a nation vulnerable to extortion and intimidation," Trump said. "That is why we congratulate European states, such as Poland, for leading the construction of a Baltic pipeline so that nations are not dependent on Russia to meet their energy needs. Germany will become totally dependent on Russian energy if it does not immediately change course."

The Russian company Gazprom is working with European partners to develop the Nord Stream 2 pipeline, which will double natural gas volumes pumped from Russia to Germany through the Baltic Sea and avoid the usual transit route Ukraine.