WASHINGTON, (AP) — Gay rights activists cheered boisterously on the steps of the U.S. Supreme Court as word trickled out Wednesday that questions inside seemed to indicate a willingness to strike down a federal law that prevents the government from recognizing same-sex marriages.

Justices including Anthony Kennedy, a closely watched swing voter, noted that the Defense of Marriage Act, or DOMA, intrudes on states’ rights to regulate marriages.

The law affects the distribution of a range of federal benefits — including tax breaks, insurance for spouses of federal employees, Social Security payments, patient visitation rights and death notification — attorneys argued Wednesday in the case brought by Edith Windsor of New York City.

Ms. Windsor, 83, claims the government violated the equal protection clause of the Constitution when it assessed her $363,000 in taxes on the estate she inherited from her deceased wife in New York, where same-sex marriage is legal. She would not have been billed for the tax had she been married to a man.

Trial and appellate courts in New York ruled in favor of Ms. Windsor. The Obama administration, which has become increasingly supportive of gay rights, enforced the tax rule but declined to defend DOMA in court. That prompted the Bipartisan Legal Advisory Group, comprising five members of Congress, to intervene in court.

The group’s intervention raises jurisdictional questions that the court will have to address before it can rule on the substantive issue: whether the federal government must treat same-sex marriages the same as traditional ones.

A similar technicality was raised in a separate same-sex marriage case the court heard Tuesday. In that case — which dealt with the constitutionality of a California ban on gay marriage — justices indicated that a wide range of options are under consideration. They include dismissing the case, issuing a narrow ruling that would apply only to California, and writing a sweeping opinion that would open the doors to same-sex marriage nationwide.

Options in the Windsor case are more limited.

Justice Stephen Breyer summed them up this way: "There has been this uniform one-man-one-woman rule for several hundred years, and there’s a revolution going on in the states. We either adopt the revolution and push it along a little, or we stay out of it."

Other justices wrestled with the fundamental question of whether the federal government or states should be the ultimate arbiters of the gay marriage issue.

Justice Ruth Bader Ginsburg, a liberal, said DOMA is problematic.

"If we are totally for the states’ decision that there is marriage between two people, for the federal government then to come in to say no joint [tax] return, no marital deduction, no Social Security benefits, your spouse is sick but you can’t get leave … one might as well ask ‘What kind of marriage is this?’ " Justice Ginsburg said.

She said federal benefits are intertwined in every aspect of married life. "It’s not that there’s this little federal sphere and it’s only a tax. It affects every area of life. It diminishes what states have said [and creates] two marriages: traditional marriage and this other thing."

Justice Elena Kagan read from a House of Representatives report indicating that when Congress passed the 1996 DOMA law it was trying to "reflect an honor of collective moral judgment and to express moral disapproval of homosexuality." She asked Paul D. Clement, attorney for the Bipartisan Legal Advisory Group: "Do we think that Congress was doing this for uniformity reasons, or do we think that Congress’s judgment was infected by dislike, by fear, by animus?"

Mr. Clement said the court needs to look beyond that phrase in the report to see lawmakers’ intent to provide statutory uniformity. He said the court shouldn’t strike down DOMA "just because a couple of legislators may have had an improper motive."

He said the report Justice Kagan read from also indicated that Congress was trying to promote democratic self-governance.

Solicitor General Donald B. Verrilli Jr. addressed that contention.

DOMA doesn’t help with uniformity and, even if it did, "basic administrative concerns ought not to be important enough to justify this kind of discrimination," he argued.

"There is no administrative advantage to be gained here … and the fundamental reality — and I think the House report makes this glaringly clear — is that DOMA was not enacted for any purpose of uniformity," he said. "It was enacted to exclude same-sex married — lawfully married — couples from federal benefit regimes based on a conclusion that was driven by moral disapproval."

Roberta K. Kaplan, who represents Ms. Windsor, said such moral disapproval was not driven by bigotry but by lawmakers’ misunderstandings in a society that, in 1996, had misconceptions about gay people.

"Back in 1996 people did not have the understanding that they have today," she argued. "It was based [on] … an incorrect understanding that gay couples were fundamentally different than straight couples, an understanding that I don’t think exists today."

Opponents of gay marriage, including those who argued a separate case before the court Tuesday, say the primary purpose of marriage is procreation and that gay couples should be excluded from the institution because they cannot reproduce.

Outside, a somewhat smaller crowd gathered Wednesday, mainly gay marriage supporters who held American and rainbow flags.

Many said they were encouraged that the issue is before the U.S. Supreme Court at all. A decade ago, no state recognized same-sex unions and 40, including Pennsylvania, still don’t.

Ms. Windsor emerged from oral arguments to a sea of rainbow flags and supporters — both friends and strangers — who chanted "Edie! Edie! Edie!" Before greeting them, Ms. Windsor stopped briefly to address a throng of reporters.

"I think [the arguments] went beautifully. I thought the justices were gentle," she said. "They were direct, they asked all the right questions and I didn’t feel any hostility or any sense of inferiority. I felt we were respected, and I think [the outcome] is going to be good," she said.

She and Thea Spyer had been a couple for more than 40 years. They married in 2007 when they were in their mid-70s, and Ms. Spyer died two years later. Then the tax man came calling.

"The federal government was treating us like strangers," she said, in assessing a tax she would have been exempt from if she had married a man.

Now 83, she is at the forefront of a national battle for same-sex marriage.

"For anyone who doesn’t understand why we want it and why we need it: It is magic," she said, recalling hundreds of phone calls and outpouring of love from old friends who had seen her wedding announcement in The New York Times.

"The fact is, everybody treated us different" after the marriage. "It’s a huge difference. [Marriage] is a magic word," she said, showing reporters the diamond lapel pin Ms. Spyer had given her when she was still closeted and afraid to wear an engagement ring.

"I am, today, an out lesbian who just sued the United States of America, which is kind of overwhelming for me," she said.

Around her, at least a thousand activists chanted slogans in support of gay marriage and carried signs with slogans such as "Some dudes marry dudes. Get over it."

Across the street, a man carrying a Bible shouted at the activists to stop sinning and repent. Around him, a handful of traditional-marriage supporters carried signs reading, "Every child deserves a mom and a dad," and "Marriage = One Man + One Woman."

Hundreds of supporters of the DOMA law marched the few blocks from the National Mall to the Supreme Court on Tuesday and then quickly dispersed, but Wednesday, few showed up.

Supporters of same-sex marriage, meanwhile, were plentiful.

Beth Pepper, 53, of Williamsburg, Va., said she is glad Ms. Windsor is standing up for people like her. Ms. Pepper married her wife, Lisa Williams, 50, two years ago in Washington, D.C., where same-sex marriage is legal. The couple has been together 14 years and has two college-age children who, because of DOMA, aren’t entitled to the medical benefits Ms. Pepper earned during her 27 years in the U.S. Coast Guard.

They stood outside the courthouse Wednesday with other activists to support the cause.

Diane Olson and Robin Tyler were among a few hundred people who waited in line for seats inside. They were the first lesbian couple to be married in California in 2008 during the brief window between a state court ruling that opened the doors to gay marriage and a ballot initiative known as Proposition 8 that slammed the door shut again.

"It is really uncomfortable to be one of the 18,000 [same-sex] married couples, knowing other people" cannot marry their same-sex partners, Ms. Olson said as she waited to be allowed inside Wednesday morning.

Sharon Lopez and Andrea Farney, civil rights attorneys from Triquetra Law in Lancaster, Pa., also were in line for a seat.

"This case is like Brown vs. Board of Education for the GLBT (gay, lesbian, bisexual and transgender) community. It’s really important," said Ms. Lopez, who came both because of her interest in the legal arguments and her support of her gay son.

"I want to be able to tell my [future] grandchildren and their father that I was here. I want them to have the same opportunities as my grandchildren from straight children," she said.

The DOMA argument followed Tuesday’s oral arguments on California’s ban on same-sex marriage, a case in which the justices indicated they might avoid a major national ruling on whether America’s gays and lesbians have a right to marry. Even without a significant ruling, the court appeared headed for a resolution that would mean the resumption of gay and lesbian weddings in California.

Decisions in both cases are expected in June.

Marital status is relevant in more than 1,100 federal laws. Lawsuits around the country have led four federal district courts and two appeals courts to strike down DOMA’s Section 3, which defines marriage. In 2011, the Obama administration abandoned its defense of the law but continues to enforce it. House Republicans are now defending DOMA in the courts.

Same-sex marriage is legal in the District of Columbia and nine states: Connecticut, Iowa, Maine, Maryland, Massachusetts, New Hampshire, New York, Vermont and Washington. It also was legal in California for less than five months in 2008.

If the Supreme Court finds that it does not have the authority to hear the case, Ms. Windsor probably would still get her refund because she won in the lower courts. But there would be no definitive decision about the law from the nation’s highest court, and it would remain on the books.