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 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.
But, given that it did, he said, "we have no power under the Constitution to invalidate this democratically adopted legislation."
NORTH ATTLEBOROUGH, Mass. (AP) - New England Patriots tight end Aaron Hernandez has been taken from his home in handcuffs after a Boston semi-pro football player was found dead in an industrial park a mile from his house.
Family members say the dead man, 27-year-old Odin Lloyd, was dating a woman whose sister is Hernandez's fiancee. Officials ruled the death a homicide but did not say how Lloyd died.
It's unclear why Hernandez was being taken into custody Wednesday morning and put into the back of a marked police car.
State police have searched in and around Hernandez's home in North Attleborough several times. At least three search warrants have been issued in connection with the investigation.
Hernandez attorney Michael Fee hasn't discussed the investigation.
FORT BRAGG, N.C. (AP) - Lawyers representing a U.S. Army general facing sexual assault charges are asking a military judge to force prosecutors to turn over any e-mails related to the case sent or received by former Defense Secretary Leon Panetta.
A court martial is set to begin at Fort Bragg next month for Brig. Gen. Jeffrey Sinclair on charges including forcible sodomy, indecent acts and violating orders.
In a motion filed Tuesday as part of a pre-trial hearing, lawyers for Sinclair argue top Pentagon brass were receiving regular updates last year on the investigation and may have encouraged subordinates to make an example of Sinclair. It is unlawful in the military justice system for senior commanders to interfere in criminal cases.
Two of Sinclair's commanders testified earlier this month there was no such pressure.