/ Updated 
By Associated Press

BUCHAREST, Romania — A gay Romanian-American couple is entitled to the same residency rights as other married couples in the European Union, a top EU legal adviser said in an opinion published Thursday.

European Court of Justice Advocate General Melchior Wathelet said the key legal issue in the case of Romanian Adrian Coman and his American husband, Claibourn Robert Hamilton, was "not that of legalization of marriage between persons of the same sex but that of freedom of movement of a Union citizen."

FILE PHOTO: Clay Hamilton, left, and Adrian Coman, are a U.S.-Romanian couple who got married in Belgium and are seeking legal recognition of their status in Romania. Photo taken on July 22, 2016.Vadim Ghirda / AP

So while the 28 European Union countries "are free to provide or not for marriage for persons of the same sex," they must not limit their application of spousal rights in a way that infringes "on the right of citizens of the Union and their family members to move and reside freely within the territory of the Member States," Wathelet wrote.

Coman has been fighting since 2012 to get his marriage to Hamilton in Belgium two years earlier recognized in Romania, which does acknowledge same-sex unions. The couple lives in New York.

Romania's Constitutional Court asked the European Court of Justice, which is based in Luxembourg, to weigh in with its legal interpretation of the case. Thursday's decision is non-binding on EU court judges, who are expected to issue a ruling this year, but they often follow the reasoning laid out by advocates general.

"We are overjoyed," Hamilton said in a written statement. "It shows the Romanian authorities were wrong to refuse to treat us as a family."

Coman added: "Romanian citizens can't be divided into good and gay. We can't be treated as inferior citizens, lacking equal rights, based on prejudices that some have about homosexuality."

The couple's case is giving the European Court of Justice its first opportunity to consider if an EU directive on the rights of citizens and their family members to "move and reside freely" within the bloc applies when married spouses are two men, according to Wathelet.

“Two years ago I was in a hospital in New York, and he came with me and talked with the doctors. As my partner, [he] is able to make certain decisions for me. This would not be possible today in Romania,” Coman said. "But the way to get there, which includes the EU Court of Justice and further the Romanian court, is what we can do."

Same-sex unions remain difficult in Romania. Homosexuality was only decriminalized in the conservative, Eastern European nation as Romania prepared to join the EU in 2002.

Some 3 million people signed a petition backing a referendum to amend the Romanian Constitution so it explicitly states that marriage only can be a union between a man and a woman.

Same-sex marriages or civil partnerships are recognized or have some protections in 22 of the 28 countries. Like Romania, Poland, Slovakia, Bulgaria, Lithuania and Latvia do not give same-sex couples any legal rights or responsibilities.

FOLLOW NBC OUT ON TWITTER, FACEBOOK AND INSTAGRAM

Brooke Sopelsa contributed.