Same sex couples who are denied marriage rights in their own state, will not be allowed to legally marry in Massachusetts, according to the Supreme Judicial Court.

The state ruled that it cannot ignore laws of other parts of the US by allowing gay couples to marry when it is prohibited back in their homes.

Eight gay couples attempted to challenge a 1913 state law that forbids non residents from marrying in Massachusetts if their marriage would not be recognised in their home state.

The court concluded, “The laws of this commonwealth have not endowed non-residents with an unfettered right to marry.”

“Only non-resident couples who come to Massachusetts to marry and intend to reside in this commonwealth thereafter can be issued a marriage license without consideration of any impediments to marriage that existed in their former home states.”

The couple’s lawyers argued that the 1913 law had been previously unused and was only brought up in an attempt by Governor Mitt Romney to discriminate against gay couples.

Mr Romney had ordered city and town clerks to enforce the 1913 law after the first same-sex marriages were performed in Massachusetts in May 2004.

Massachusetts was the first US state to legalise gay marriage.