(FOX NEWS) -- The Supreme Court ruled Wednesday that the federal Defense of Marriage Act is unconstitutional, striking down a provision that denied benefits to legally married gay couples.
The 5-4 ruling -- a major victory for gay-rights advocates -- means those same-sex couples would be eligible for federal benefits.
Justice Anthony Kennedy wrote the majority opinion.
"DOMA divests married same-sex couples of the duties and responsibilities that are an essential part of married life and that they in most cases would be honored to accept were DOMA not in force," he wrote.
Kennedy wrote that the law "places same-sex couples in an unstable position of being in a second-tier marriage."
The ruling prompted tension among the divided court. Multiple dissenting opinions were filed. Justice Antonin Scalia, reading from his dissent, said the components of the majority's ruling are "wrong."
"The error in both springs from the same diseased root: an exalted notion of the role of this Court in American democratic society," he said
The provision in question defined marriage as between a man and woman and in doing so prevented married gay couples from receiving a range of tax, health and retirement benefits that are generally available to married people.
Same-sex marriage has been adopted by 12 states and the District of Columbia. Another 18,000 couples were married in California during a brief period when same-sex unions were legal there.
The court has yet to release its decision on California's ban on same-sex marriage.
"Under DOMA, same-sex married couples have their lives burdened, by reason of government decree, in visible and public ways," Kennedy said.
"DOMA's principal effect is to identify a subset of state-sanctioned marriages and make them unequal," he said.
He was joined by the court's four liberal justices.
Chief Justice John Roberts and Justices Samuel Alito, Antonin Scalia and Clarence Thomas dissented.
Scalia read his dissent aloud. Scalia said the court should not have decided the case.