The European Court of Justice (ECJ) on Tuesday ruled that member states must recognize the legal marriages of gay and lesbian couples performed within the European Union (EU).

The case involves a Romanian man, Adrian Coman, and his American husband, Clai Hamilton, who married in 2010 in Brussels. Romania had refused to recognize Hamilton as Coman's spouse, a necessary step for Hamilton to live in Romania.

The ECJ ruled in favor of Coman, who is seeking the right to have Hamilton live with him in Romania. The court said that the term “spouse” was gender neutral.

“Although the member states have the freedom whether or not to authorize marriage between persons of the same sex, they may not obstruct the freedom of residence of an EU citizen by refusing to grant his same-sex spouse, a national of a country that is not an EU Member State, a derived right of residence in their territory," the court said.

Coman told reporters that the ruling is a win for “human dignity.”

“We can now look in the eyes of any public official in Romania and across the EU with certainty that our relationship is equally valuable and equally relevant,” Coman told reporters following the ruling.

“We are grateful to the EU Court and to the many people and institutions who have supported us, and through us, other same-sex couples in a similar situation," he added. "It is human dignity that wins today."