A European court has made a landmark ruling in favour of an American-Romanian gay couple who wanted to settle in Romania, a country that does not recognise gay marriage.

The European Court of Justice, the EU’s top court, today ruled that Romania must give residency to US citizen Claibourn Robert Hamilton on the grounds that he was the spouse of Romanian citizen Adrian Coman.

The decision came after the couple, who married in Belgium in 2010, requested a residency for Hamilton to live and work permanently in Romania in December 2012, but was turned down because Romania does not recognise same-sex marriage.

Romanian authorities said Hamilton could not be classified as a “spouse” because gay marriage is illegal in Romania.

The couple challenged the country's decision in 2013 based on the EU’s freedom of movement directive, which permits the spouse of an EU citizen to join their partner in the member state where the EU citizen resides.

Romania's Constitutional Court referred the case to the European Court of Justice in November 2016.

The ECJ found that the term "spouse" in this directive includes same-sex partners, even if the country where residency is being requested does not recognise gay marriage.

“Although the Member States have the freedom whether or not to authorise 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 on Tuesday.

When the case went before the ECJ, legal experts told the New York Times it could determine whether same-sex partners were given the same benefits and rights available to heterosexual spouses across the 28-member bloc, irrespective of the countries’ stance on same-sex marriage.