WARSAW, Poland — Catholic leaders in central Europe vowed to uphold church teachings on marriage after Europe’s highest court ruled same-sex married couples should have residence rights in all countries.

“Groups who think differently about marriage will certainly see this as a new opportunity,” said Father Francisc Ungureanu, secretary-general of the Romanian Catholic bishops’ conference.

“But we’re confident the truth about human life and marriage will remain the same, and we’ll count on politicians and legislators not to defy this. The very function of law and justice is to say what marriage is and protect it,” he told Catholic News Service.

The Luxembourg-based European Court of Justice upheld June 5 the right of a Romanian gay man, Adrian Coman, to have his American marriage partner, Claibourn Robert Hamilton, living with him.

Welcoming the June 5 ruling as a “win for human dignity,” Coman said it would enable the couple to “look in the eyes of any public official in Romania and across the EU certain our relationship is equally valuable and equally relevant.”

Ungureanu said June 8 the court issued its judgment at the request of Romanian judges, making it a “purely legal matter” which would not pressure the church to change its position.

Elsewhere, Archbishop Stanislaw Zvolensky of Bratislava, Slovakia, president of Slovakia’s bishops’ conference, said “legal chaos” would result if countries not recognizing same-sex marriage were forced to give greater rights to foreign nationals than to their own citizens.

“The EU’s constitution stipulates that countries draw inspiration from Europe’s cultural, religious and humanist heritage, but this move contradicts human rights, natural law and common sense,” Zvolensky said in a letter to Koen Lenaerts, the court’s president.

“The court is trampling on the EU’s founding principles and ideas: Democracy, the rule of law, human dignity and universal values,” the archbishop said.

European Union law permits spouses of EU citizens to join them in their country of residence, but was believed by Romania’s Supreme Court not to apply to Hamilton, whose marriage to Coman was contracted in Belgium in 2010.

However, the court said the term spouse was “gender-neutral,” ruling that residence and free movement rights should extend to all marriage partners even in countries not allowing same-sex unions.

Media commentators said Romania would now come under pressure to recognize same-sex marriages and partnerships, which are legal in most EU countries but not in Bulgaria, Latvia, Lithuania, Poland, Romania and Slovakia.

However, that view was rejected in a June 5 statement by Vasile Banescu, spokesman for Romania’s Orthodox patriarchate, who vowed same-sex marriage would “remain forbidden and unrecognized” in his country.

Ungureanu told CNS that pressure from churches would continue to ensure support for “traditional marriage and family life” in the country, which decriminalized homosexuality in 2002.

“EU officials may well try to force changes here, as they’ve done in other countries,” Ungureanu said.

“Let’s hope they won’t risk action they’ve no mandate for,” he added. “If the notion of a spouse is redefined, then other features of marriage will be challenged as well.”

Romania’s Supreme Court sought the European court ruling in November 2016 on whether the EU’s 2004 Free Movement Directive and family privacy clauses in the Charter of Fundamental Rights of the European Union applied to same-sex couples after immigration officials refused Hamilton residence beyond three months.