WASHINGTON (AP) — Concluding two days of intense debate, the Supreme Court signaled Wednesday it could give a boost to same-sex marriage by striking down the federal law that denies legally married gay spouses a wide range of benefits offered to other couples.

As the court wrapped up its remarkable arguments over gay marriage in America, a majority of the justices indicated they will invalidate part of the federal Defense of Marriage Act — if they can get past procedural problems similar to those that appeared to mark Tuesday’s case over California’s ban on same-sex marriage.

Since the federal law was enacted in 1996, nine states and the District of Columbia have made it legal for gays and lesbians to marry. Same-sex unions also were legal in California for nearly five months in 2008 before the Proposition 8 ban.

Justice Anthony Kennedy, often the decisive vote in close cases, joined the four more-liberal justices in raising questions Wednesday about a provision that defines marriage as the union of a man and a woman for purposes of federal law.

It affects more than 1,100 statutes in which marital status is relevant, dealing with tax breaks for married couples, Social Security survivor benefits and, for federal employees, health insurance and leave to care for spouses.

Kennedy said the Defense of Marriage Act appears to intrude on the power of states that have chosen to recognize same-sex marriages. When so many federal statutes are affected, “which in our society means that the federal government is intertwined with the citizens’ day-to-day life, you are at real risk of running in conflict with what has always been thought to be the essence of the state police power, which is to regulate marriage, divorce, custody,” Kennedy said.

Other justices said the law creates what Justice Ruth Bader Ginsburg called two classes of marriage, full and “skim-milk marriage.”

If the court does strike down part of DOMA, it would represent a victory for gay rights advocates. But it would be something short of the endorsement of gay marriage nationwide that some envisioned when the justices agreed in December to hear the federal case and the challenge to California’s ban on same-sex marriage.

Still, the tenor of the arguments over two days reflected how quickly attitudes have changed since large majorities in Congress passed the federal DOMA in 1996 and President Bill Clinton signed it into law. In 2011, President Barack Obama abandoned the legal defense of the law in the face of several lawsuits, and last year Obama endorsed gay marriage. Clinton, too, has voiced regret for signing the law and now supports allowing gays and lesbians to marry.

In 1996, the House of Representatives’ report on the legislation explained that one of its purposes was “to express moral disapproval of homosexuality.” Justice Elena Kagan read those words in the courtroom Wednesday, evoking a reaction from the audience that sounded like a cross between a gasp and nervous laughter.

Kagan’s quotation gave lawyer Paul Clements, representing the Republican-controlled House of Representatives that has taken up defense of the law in place of the administration, some uncomfortable moments at the lectern.

“Does the House report say that? Of course, the House report says that. And if that’s enough to invalidate the statute, then you should invalidate the statute,” Clement said. But he said the more relevant question is whether Congress had “any rational basis for the statute.” He supplied one: the federal government’s interest in treating same-sex couples the same no matter where they live.