The court invalidated a provision of the federal Defense of Marriage Act that has prevented married gay couples from receiving a range of tax, health and retirement benefits that are generally available to married people. The vote was 5-4.
Justice Anthony Kennedy wrote the majority opinion.
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 Supreme Court also cleared the way for same-sex marriage in California by holding that defenders of California's gay marriage ban did not have the right to appeal lower court rulings striking down the ban. The court's 5-4 vote Wednesday leaves in place the initial trial court declaration that the ban is unconstitutional. California officials probably will rely on that ruling to allow the resumption of same-sex unions in about a month's time.