A 1913 Massachusetts law being used to prevent out-of-state gays from getting married here is discriminatory and should be struck down, a lawyer for eight same-sex couples (search) told a judge Tuesday.

Attorney Michele Granda asked Superior Court Judge Carol Ball for an injunction blocking the state from enforcing the 91-year-old law, which prohibits marriages that would be illegal in a couple's home state. She said the statute violates both the U.S. Constitution and Massachusetts (search) law.

The couples are suing to overturn the law, which the state has used to bar out-of-state couples from marrying in Massachusetts, the only state where such marriages are recognized.

"We're asking the court to tear down the fence of discrimination that's been erected around [the state's] borders," she said.

But an attorney for the state countered that the law protects other states' rights to define marriage as they see fit, a principle repeatedly cited by the Massachusetts high court in its landmark November ruling legalizing gay marriage.

Assistant Attorney General Peter Sacks said that ruling defines marriage as "two willing spouses and an approving state." Since no other state allows gay marriages, that standard is not met anywhere but Massachusetts, he said.

Ball gave the state until Aug. 2 to file its response. She did not say when she would rule, but noted: "From what I've read so far, it appears the state is applying the law in a procedurally non-discriminatory manner."

Republican Gov. Mitt Romney (search), a gay marriage opponent, has invoked the 1913 law to bar gay couples from other states from getting married here.

When gay marriages began May 17, some municipal clerks openly defied Romney and issued licenses to anyone who applied. But Massachusetts' attorney general, acting on Romney's instructions, ordered them to stop.

Legal experts have said the law was passed to prevent interracial couples from getting married. But the attorney general has said there is no evidence lawmakers were motivated by race.

At any rate, the law was ignored for decades before the high court cleared the way for the nation's first state-sanctioned gay weddings to begin this spring, Granda said.

Sacks did not dispute that assertion. "Certainly enforcement has been increased because there's much more reason than there was before to expect violations," he said.

Granda also argued the state is treating different groups of people unequally by enforcing the law. "The commonwealth can't use its formidable authority to bar gays and lesbians from marrying simply because they are gays and lesbians," she said.

Sacks said, however, that Massachusetts' enforcement of the law respects other states' rights. "People can come here from out of state to get married, if they're coming from a jurisdiction where it's recognized," he said.

Of the eight couples who filed the lawsuit, two are from Connecticut, two from Rhode Island, and one each from New Hampshire, Vermont, Maine and New York.

Five of the couples were married in Massachusetts by clerks who ignored the 1913 law, while the three others were turned away when they tried to get marriage licenses.