In two major decisions Wednesday the Supreme Court struck down a key provision of the Defense of Marriage Act (DOMA), ruling that same-sex spouses legally married in a state may receive federal benefits, but upheld parts of California’s law restricting marriage between couples of the same sex.

The ruling in DOMA, on a 5-4 vote, means that legally married same-sex couples are entitled to claim the same federal benefits that are available to opposite-sex married couples.Justice Anthony Kennedy wrote in the majority opinion that the Defense of Marriage Act violates the U.S. Constitution’s guarantee of equal protection.

“The federal statute is invalid, for no legitimate purpose overcomes the purpose and effect to disparage and to injure those whom the state, by its marriage laws, sought to protect in personhood and dignity,” Kennedy wrote.

In its decision to strike down Section 3 of the law, the Court cleared the way to more than 1,100 federal benefits, rights and burdens linked to marriage status for gay couples.

Kennedy, often the court’s swing vote in close decisions, also said the law imposes “a stigma upon all who enter into same-sex marriages made lawful by the unquestioned authority of the states.”

In another 5-4 vote, the Court also ruled that supporters of the ban on gay marriage in California, Proposition 8, did not have standing to defend the law. That ruling effectively gave the green light for at least some gay weddings to proceed in California, and a federal judge’s original ruling that struck down the law will remain intact.