The battle over same-sex marriage intensified this week after a federal judge in Massachusetts ruled unconstitutional the 1996 law that forbids the federal government to recognize gay marriages, a decision that could have repercussions in the District and the five states that allow gay unions.

Gay rights groups celebrated the decision, hailing it as a small but important step in the effort to secure equal marriage rights for same-sex couples. Opponents immediately sounded the alarm, accusing the Obama administration of not vigorously defending existing law and faulting U.S. District Judge Joseph L. Tauro in Boston for taking an activist stance in his rulings on two cases Thursday.

As both sides await news of a likely appeal that could eventually lead to the Supreme Court, they are keeping an eye on California. A federal judge in San Francisco is expected to rule any day on whether voters in that state were within their rights when they supported a 2008 ballot initiative that banned same-sex marriage. That decision could have major reverberations around the country and also end up before the nation's highest court.

The Massachusetts rulings, though less far-reaching, are "another domino that's been pushed over in the attempt by the left to alter the fundamental definition of marriage," said Bruce Hausknecht, a judicial analyst with CitizenLink, an affiliate of the conservative Focus on the Family.

Gay marriage is legal in five states, including Massachusetts, and in the District. However, same-sex married couples are disqualified from receiving marriage-based federal benefits under the 1996 Defense of Marriage Act, or DOMA, which was the subject of Tauro's decision.

Evan Wolfson, director of the gay advocacy group Freedom to Marry, called the law "a radical blot on the American constitution" because it singles out a particular group for discrimination, and he praised Tauro's finding that the law violated the equal rights of gay couples. Opponents of same-sex marriage said the federal law was a necessary backstop to prevent states from overstepping their bounds and undermining traditional notions of marriage.

President Obama has said he personally opposes DOMA, but his administration is bound to defend it as the law of the land. The Justice Department is expected to appeal the decision, which came in the form of rulings on separate cases brought by the nonprofit Gay and Lesbian Advocates and Defenders, or GLAD, and Massachusetts Attorney General Martha Coakley.

GLAD filed suit on behalf of seven gay couples and three survivors of same-sex spouses who had been denied federal benefits. One plaintiff was a U.S. Postal Service employee of 22 years who wanted to extend her employment-based health insurance to her wife. Another couple had tried unsuccessfully to file their taxes jointly. In a narrow decision that applies only to these individuals, Tauro determined that the plaintiffs had been unfairly denied benefits.

In a case that has broader implications, Coakley had made a states' rights argument that DOMA required the state to discriminate against its own citizens. For example, the state would have risked losing federal funding if it had granted the request of a gay war veteran who had asked to be buried in a federally subsidized veterans cemetery with his spouse.

"We used that example to illustrate the harm that same-sex couples were suffering as a result of DOMA as a discriminatory and unconstitutional law," said Amie Breton, a spokeswoman for Coakley's office. She said that as a result of the ruling, gay married couples in Massachusetts were immediately eligible to apply for Social Security and other federal benefits for their spouses.

A spokeswoman for the Justice Department said the agency is reviewing Tauro's decision. If upheld by higher courts, the decision could have implications in states that allow gay marriage.

"There is a sense in which this case is very significant, and there is a way in which it is a tiny step," said Gary Buseck, legal director for GLAD. "If the . . . case goes all the way to the United States Supreme Court and we get as broad a ruling as we could possibly get, it will not bring marriage equality to the country."

More significant, he and others say, could be the outcome of the California case. There, U.S. District Judge Vaughn R. Walker is being asked to decide whether voters violated the U.S. Constitution by passing Proposition 8, a referendum measure two years ago that defined marriage as between a man and a woman.

Supporters of gay marriage say the outcome of that case could be as significant from a civil rights perspective as Loving v. Virginia, the case that invalidated that state's ban on interracial marriage. Opponents say a more apt comparison would be to Roe v. Wade, the decision that legalized abortion and inflamed social tensions.

"In the same way, this is a good-faith dispute among people of goodwill who just disagree about the rightness and wrongness of the practice," said Robert George, a constitutional law professor at Princeton University and an opponent of gay marriage. "There's no neutral middle ground. A decision will have to be made."