BRUSSELS (Reuters) - European Union countries should accord a same-sex spouse the right to live and work there even if they do not allow gay marriage, a senior adviser to the top EU court said on Thursday.

The European Court of Justice (ECJ) will still need to rule on the case -- brought by a man whose American husband was refused residence in his home country of Romania -- which could expand legal recognition of same-sex marriages across Europe.

Advocate General Melchior Wathelet said the term “spouse” should include partners of the same sex when it came to the freedom of residence of EU citizens and their family members. Judges are not bound by the advocate general’s view, but tend to follow it.

“Although member states are free to authorize marriage between persons of the same sex or not, they may not impede the freedom of residence of an EU citizen by refusing to grant his or her spouse of the same sex, a national of a non-EU country,” Wathelet said in his opinion.

The Romanian man who brought the case married an American man in 2010 in Belgium, where same-sex marriages are allowed, and then sought a residence permit for his spouse from the Romanian authorities.

They turned down the request because Romanian law prohibits same-sex marriages and does not recognize such marriages that have taken place abroad.

The couple said the decision was discriminatory and challenged it in Romanian courts. Romania’s Constitutional Court asked the European Court of Justice whether the non-EU spouse should be regarded as a spouse eligible to claim a right of residence.