FISH are the gender-benders par excellence of the animal kingdom, and a study of cells from the testes of trout is helping to reveal why.

Goro Yoshizaki and his team from Tokyo University of Marine Science and Technology in Japan investigated the germ cells from adult male rainbow trout that normally give rise to sperm. When they took these cells and transplanted them into the body cavities of female hatchlings, they migrated to the host fishes' ovaries. There they developed into eggs that when fertilised grew into healthy offspring (Proceedings of the National Academy of Sciences, DOI: 10.1073/pnas.0509218103).

This cellular flexibility may explain why fish are susceptible to feminisation by pollutants that mimic the female hormone oestrogen. It also probably underpins the ability of some species to change sex as they mature, to maximise their reproductive success. Some even change back and forth repeatedly.

Yoshizaki hopes his finding can be put to practical use by fish breeders. Bluefish tuna, in particular, are highly prized for sushi in Japan, but populations are declining worldwide. This new technique may help boost egg stocks.

BOSTON, March 30 — Massachusetts's highest court, which legalized same-sex marriage here two and a half years ago, ruled Thursday that gay couples who live in states where such marriages are prohibited cannot marry in Massachusetts.

But the ruling left open the possibility that gay couples from states like New York and Rhode Island that do not explicitly ban same-sex marriage might be able to marry in Massachusetts.

The justices sent the cases of three of eight plaintiff couples, one from New York and two from Rhode Island, back to Superior Court to decide "whether same-sex marriage is prohibited in those states."

But couples from the vast majority of states cannot marry here because those states have either laws or constitutional amendments that bar same-sex marriage. The National Gay and Lesbian Task Force said the only other jurisdictions that do not specifically prohibit same-sex marriage are New Jersey, New Mexico and the District of Columbia.

The ruling, supported by six of the court's seven justices, upheld a 1913 law that says that no out-of-state resident can marry in Massachusetts if the marriage would be void in the person's home state, unless the person intends to live in Massachusetts.

"The laws of this commonwealth have not endowed nonresidents with an unfettered right to marry," Justice Francis X. Spina wrote in one of two concurring opinions, adding, "Massachusetts can reasonably believe that nonresident same-sex couples primarily are coming to this commonwealth to marry because they want to evade the marriage laws of their home states" and "Massachusetts should not be encouraging such evasion."

Chief Justice Margaret H. Marshall, who wrote the Supreme Judicial Court's November 2003 decision making same-sex marriage legal, wrote in the other concurring opinion, "It is rational for the legislature to take steps to ensure that marriages performed here will hold up elsewhere, and that they will not be ignored by other states."

Only one justice, Roderick L. Ireland, dissented, writing that "the commonwealth's resurrection of a moribund statute to deny nonresident same-sex couples access to marriage is not only troubling" but "also is fundamentally unfair."

The lawsuit began after same-sex marriage became legal in Massachusetts in May 2004 and Gov. Mitt Romney, an opponent of it, invoked the 1913 statute, which had been originally adopted in part to block interracial marriages. Mr. Romney refused to record out-of-state marriages, saying, "Massachusetts should not become the Las Vegas of same-sex marriage."

The decision by Mr. Romney, a Republican, was backed by the state's attorney general, Thomas F. Reilly, a Democrat.

Eight couples from Connecticut, Maine, New Hampshire, New York, Rhode Island and Vermont sued, along with 12 Massachusetts cities and towns, claiming that the 1913 statute was discriminatory and had been invalidated by the legalization of same-sex marriage here.

On Thursday, the clerk of one of those towns, Margaret Drury of Cambridge, said, "We really feel like we are being forced to discriminate against out-of-state couples."

According to the State Department of Public Health, 7,341 same-sex couples married in Massachusetts from May 17, 2004, to Dec. 31, 2005, but the state does not keep track of how many were from out of state.

Mark Pearsall, 38, of Lebanon, Conn., who married his partner, Paul Trubey, 42, in Massachusetts in 2004 after Mr. Pearsall's mother, dying of cancer, gave them her engagement and wedding rings, said the ruling was "very disappointing for us."

"But ultimately we consider ourselves married," Mr. Pearsall said.

Although their marriage is invalid and they could have a civil union in Connecticut, Mr. Trubey said that would feel "like the back of the bus."

Amy Zimmerman, 33, who lives in New York City with Tanya Wexler, 35, and their four children, said she was "hopeful that the door seems to have been left open" for her marriage in May 2004 to be made official if the Superior Court decides that New York State does not bar same-sex marriage.

An appeals court in New York is scheduled to hear arguments in May in a lawsuit challenging state officials' interpretation that same-sex marriage is illegal in the state.

Governor Romney, in an interview Thursday, said, "This is an important victory for traditional marriage and for the right of each state to be sovereign as it defines marriage. It's very important to contain a bad initial decision on same-sex marriage by this court and not impose it on the other 49 states."

Peter Sprig, vice president for policy at the Family Research Council, called the ruling "gratifying" and said conservative groups would continue to push for a federal constitutional amendment against same-sex marriage and for similar amendments in states that do not already have them. Such an amendment will come before the Massachusetts legislature in May.

Advocates for same-sex marriage said they were disappointed by the Massachusetts ruling.

"I had very high hopes about this decision," said Matt Foreman, executive director of the National Gay and Lesbian Task Force.

Michele E. Granda, a lawyer for Gay and Lesbian Advocates and Defenders, which represented the plaintiffs, said that while her side had the option of asking the United States Supreme Court to hear an appeal, it was much more likely that her group would focus on the New York and Rhode Island cases, and would press the Massachusetts legislature to repeal the 1913 law.

A bill to repeal the law passed the State Senate overwhelmingly in 2004 but was not taken up in the House of Representatives, which at the time was led by a speaker who opposed same-sex marriage. It was recently reintroduced.

"This is a ridiculous, confusing and badly formed law," Ms. Granda said. "We live in a mobile society, and where someone lives today may have no meaning for them when they go on vacation next month or relocate a year from now."

The court that legalized gay marriage in Massachusetts ruled that same-sex couples from other states that prohibit gay unions could not come here to marry.

"The laws of this Commonwealth have not endowed non-residents with an unfettered right to marry," Justice Francis Spina ruled in an opinion released by the state's Supreme Judicial Court.

"Simply put, given the enormity of the rights and responsibilities that accompany marriage, Massachusetts has a rational and substantial interest in ensuring that the marriages it creates will be recognized as valid outside its borders," Spina added.

The ruling upheld a 1913 statute that bars an out-of-state resident -- unless the person intends to settle in Massachusetts -- from marrying here if the union would be void in the person's home state.

Five justices concurred wholly or in part with Spina's opinion, while one dissented.

The ruling was largely a defeat for eight same-sex couples from outside Massachusetts who had filed a suit claiming the 1913 statute is discriminatory.

However, the ruling did hold out hope for some of the plaintiffs -- couples from New York and Rhode Island, which have no specific legislation outlawing gay marriage.

A lower-court judge was ordered to reconsider those specific cases with a view to determining whether same-sex marriages were indeed prohibited in those two states.

Since gay marriage was legalized in Massachusetts in May 2004, hundreds of out-of-state, same-sex couples have come to the state seeking a marriage license.

Massachusetts Governor Mitt Romney, a Republican and a staunch opponent of gay marriage, welcomed Thursday's ruling as an "important victory" for traditional marriage.

"It would have been wrong for the Supreme Judicial Court to impose its mistaken view of marriage on the rest of the country," Romney said.

"The continuing threat of the judicial redefinition of marriage, here and in several other states, is why I believe that the best and most reliable way to preserve the institution of marriage is to pass an amendment to the US Constitution," he added.

An opposing reaction came from veteran Massachusetts Senator Edward Kennedy, who said he looked forward to a day when all US states would end the "existing bigotry" and abolish "discriminatory" laws that prevent same-sex marriage.

Gay couples from American states that ban same-sex marriages cannot legally be wed in Massachusetts, where such unions are legal, the state's highest court ruled on Thursday.

The ruling was made in response to a lawsuit filed by gay couples from Connecticut, Maine, New Hampshire and Vermont, which prohibit same-sex marriage. It appeared to end the prospect that the liberal New England state could become a U.S. destination for gay couples to marry.

The Supreme Judicial Court of Massachusetts made its ruling after Republican Gov. Mitt Romney had ordered local authorities to refuse applications from gays to be wed in Massachusetts because they resided outside the state.

"This is an important victory for those of us who wanted to preserve traditional marriage and to make sure that the mistake of Massachusetts doesn't become the mistake of the entire country," Romney told reporters after the decision.

"We did not want Massachusetts to become the Las Vegas of same-sex marriage."

Those couples who sued had sought to be married in Massachusetts after it became the first U.S. state to recognize such marriages in 2004. The issue has produced a divisive, national debate over such unions.

The case was focused on an obscure law passed in 1913 that bars out-of-state couples from marrying in Massachusetts if their own states fail to recognize the union.

After Massachusetts legalized gay marriage, Romney ordered town clerks to invoke that statute. That forced town clerks to rebuff hundreds of marriage applications from out-of-state gay and lesbian couples.

Laurence Pizer, a clerk in the town of Plymouth who had to enforce Romney's order, said he was disappointed with the court's ruling.

"The governor ... was using this law to discriminate against a class of citizens," Pizer said, one of about a dozen clerks from Massachusetts towns who in October said they supported the plaintiffs, arguing that towns lacked the resources to interpret the marriage laws of other states.

Michele Granda, a lawyer with Gay & Lesbian Advocates & Defenders who represented the couples, said that the 1913 law should be abolished.

"This was an archaic law that had never been enforced before and was brought back to life to stop same-sex couples from marrying," he said.

Romney, a likely contender for the Republican presidential nomination in 2008, reiterated his call for an amendment to the U.S. Constitution to ban gay marriages.

Thursday's ruling left the door open for some plaintiffs in the case -- couples from New York and Rhode Island. The court ordered a lower-court judge to determine whether gay marriages are prohibited in those states because of cases pending.

New York's highest court will hear oral arguments on the constitutionality of banning same-sex marriage on May 31. In Rhode Island, lawmakers have introduced proposals to legalize same-sex unions.

Thursday's decision does not affect the rights of Massachusetts residents, although opponents of gay marriages are seeking other avenues to stop such unions.

In a disappointment for the gay rights movement, the state's highest court ruled Thursday that same-sex couples from states where gay marriage is prohibited cannot tie the knot in Massachusetts.

Gov. Mitt Romney, a Republican who is considering a run for president in 2008, welcomed the decision, saying he did not want Massachusetts to become "the Las Vegas of same-sex marriage."

The Supreme Judicial Court upheld a 1913 state law that forbids nonresidents to marry in Massachusetts if their marriage would not be recognized in their home state.

If the court had struck down the law, Massachusetts would have been thrown open to gay couples from across the country to get married. Then they could have returned to their home states to fight for legal recognition for those marriages.

Massachusetts "has a significant interest in not meddling in matters in which another state, the one where a couple actually resides, has a paramount interest," Justice Francis Spina wrote.

The state "can reasonably believe that nonresident same-sex couples primarily are coming to this commonwealth to marry because they want to evade the marriage laws of their home states, and that Massachusetts should not be encouraging such evasion."

The ruling leaves in legal limbo an undetermined number of out-of-state gay couples who got married in 2004 in Massachusetts when it became the first state to let gays wed.

Arline Isaacson of the Massachusetts Gay and Lesbian Political Caucus called the decision "a painful reminder that we remain second-class citizens."

"It's painful to know you'll be treated equally under the law if and only if you happen to live here," she said. "Otherwise, you are completely unequal as a gay person."

But the governor said: "It's important that other states have the right to make their own determination of marriage and not follow the wrong course that our Supreme Judicial Court put us on."

According to the Registry of Vital Records and Statistics, 7,341 gay couples tied the knot in Massachusetts between the first marriages in May 2004 and December 2005. The state does not track how many out of state couples were given licenses in Massachusetts.

Eight gay couples from surrounding states had challenged the 93-year-old law. Five of those eight couples received marriage licenses in Massachusetts before the governor ordered city and town clerks to enforce the 1913 law.

In Thursday's ruling, six justices ruled against the gay couples in two separate opinions. Only one member of the seven-justice court dissented.

However, the court sent the cases involving couples from Rhode Island and New York back to a lower court, saying it was unclear whether those states prohibit same-sex marriage.

New York's top officials have said same-sex marriage is illegal in the state, although that interpretation is being challenged.

"We do consider ourselves still married," said Amy Zimmerman, 33, of New York City, who has a marriage license with Tanya Wexler, 35. "There is a limbo element to it. We are not exactly sure what is all means yet."

In arguments before the high court in October, a lawyer for the gay couples said the 1913 law had been unused for decades until it was "dusted off" by Romney in an attempt to discriminate against same-sex couples.

As for the out-of-state couples who obtained licenses before the law was enforced, the legality of their marriages will have to be determined in their home states on a case-by-case basis, state Attorney General Thomas Reilly said.

One justice voted to strike down the 1913 law, saying it was "deeply rooted in discriminatory notions of marriage." Gay rights advocates have argued that the law was aimed at interracial marriages.

The "resurrection of a moribund statute to deny nonresident same-sex couples access to marriage is not only troubling ... but also fundamentally unfair," Justice Roderick Ireland wrote. "This law has not been enforced for almost 100 years, and certainly never with the vitriol on display."