WASHINGTON — In a long-sought victory for the gay rights movement, the Supreme Court ruled Friday that the Constitution guarantees a nationwide right to same-sex marriage.
Justice Anthony M. Kennedy wrote the majority opinion in the 5-4 decision. He was joined by the court’s four more liberal justices.
The decision, the culmination of decades of litigation and activism, came against the backdrop of fast-moving changes in public opinion, with polls indicating that most Americans now approve of same-sex marriage.
As in earlier civil rights cases, the Supreme Court had moved cautiously and methodically, laying careful judicial groundwork for a transformative decision.
As late as October, the justices ducked the issue, refusing to hear appeals from rulings allowing same-sex marriage in five states. That decision delivered a tacit victory for gay rights, immediately expanding the number of states with same-sex marriage to 24, along with the District of Columbia, up from 19.
Largely as a consequence of the Supreme Court’s decision not to act, the number of states allowing same-sex marriage has since grown to 36, and more than 70 percent of Americans live in places where gay couples can marry.
The court did not agree to resolve the issue for the rest of the nation until January, in cases filed by gay and lesbian couples in Kentucky, Michigan, Ohio and Tennessee. The court heard extended arguments in April, and the justices seemed sharply divided over what the Constitution has to say about same-sex marriage.
Lawyers for the plaintiffs said their clients had a fundamental right to marry and to equal protection, adding that the bans they challenged demeaned their dignity, imposed countless practical difficulties and inflicted particular harm on their children.
Lawyers for the four states said their bans were justified by tradition and the distinctive characteristics of opposite-sex unions. They added that the question should be resolved democratically, at the polls and in state legislatures, rather than by judges.
A decision in United States v. Windsor provided the movement for same-sex marriage with what turned out to be a powerful tailwind. The decision struck down the part of the Defense of Marriage Act that barred federal benefits for same-sex couples married in states that allowed such unions.
The Windsor decision was based partly on federalism grounds, with Justice Anthony M. Kennedy’s majority opinion stressing that state decisions on how to treat marriages deserved respect.