The Supreme Court on Wednesday struck down a key piece of the federal Defense of Marriage Act (DOMA), which denies federal recognition to same-sex marriages.

The court ruled 5-4 that Section 3 of the law, which prevents married same-sex couples from receiving federal benefits, is unconstitutional because it “violates basic due process and equal protection principles applicable to the federal government.”

“DOMA’s avowed purpose and practical effect are to impose a disadvantage, a separate status, and so a stigma upon all who enter into same-sex marriages made lawful by the unquestioned authority of the states,” Justice Anthony Kennedy wrote in the majority opinion.

Chief Justice John Roberts, Justice Antonin Scalia and Justice Samuel Alito wrote three separate dissenting opinions, with Scalia arguing that the court should not have ruled on DOMA and that it was wrong on the merits.

The court did not rule on the merits of Hollingsworth v. Perry, another notable gay marriage case centering on Proposition 8, a California ballot initiative that banned gay marriage in the state. A federal judge struck down the ban and, after state officials declined to defend the measure on appeal, its private sponsors pursued the appeal with the 9th Circuit.

The Supreme Court, however, ruled 5-4 that the sponsors did not have the standing to defend the law. “We have never before upheld the standing of a private party to defend the constitutionality of a state statute when state officials have chosen not to. We decline to do so for the first time here,” Chief Justice John Roberts wrote for the majority. Roberts was joined in his opinion by Justices Ruth Bader Ginsburg, Antonin Scalia, Elena Kagan and Stephen Breyer.

Instead the high court sent the case back to California, where the district court’s decision to invalidate the initiative stands.

Although neither ruling held that gay couples have a constitutional right to marriage, they still represent victories for gay rights advocates.

For more InsideCounsel coverage of the gay marriage debate, see:

Rhode Island becomes 10th state to legalize gay marriage

High court hears cases on gay marriage

2nd Circuit strikes down Defense of Marriage Act

Boy Scouts reaffirm policy against admitting gay leaders

1st Circuit strikes down DOMA, sets stage for SCOTUS ruling on gay marriage