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."
OMAHA, Neb. (AP) -- When UCLA's baseball players went to the weight room for workouts, there were reminders all around about what their program lacked.
Every other sport at the famed school had at least one national championship recognized on the wall.
"We've got to get our name on that board," Nick Vander Tuig remembers coach John Savage telling his players last fall.
Finally, baseball is represented among the NCAA-record 109 team national championships in Westwood.
The Bruins secured their first title Tuesday night with an 8-0 victory over Mississippi State that completed a two-game sweep in the College World Series finals.
"We believed we were the best team in the country from the get-go," second baseman Cody Regis said. "We had that mindset that we weren't going to stop until July 1. That's what Coach always said: `Season ends July 1 when the tournament is over. And I think we are here because we believed throughout in the process."
That process focused squarely on pitching and defense. The Bruins were among the best in the nation in both. The offense produced just enough. On Tuesday, though, the offense stole the show.
Eric Filia drove in a career-high five runs for the Bruins, who collected 12 hits and scored their most runs in 18 games, and Vander Tuig limited Mississippi State to five hits in eight innings.
"They had a great year," Savage said of his players, "and it was one of those situations where it was our time."
Adam Plutko, the Bruins' No. 1 starter, was chosen the CWS Most Outstanding Player. He beat LSU in the Bruins' first game and was the winner in Game 1 of the finals. He allowed two runs in 13 innings.
Vander Tuig held off the Bulldogs (51-20) when they threatened in the fourth, fifth and eighth innings to record his fourth win in the NCAA tournament. Vander Tuig (14-4) struck out six and walked one. David Berg pitched the ninth.
Filia produced runs with a sacrifice fly, squeeze bunt and two base hits.
"To beat us like they did today, and to do what they did to our pitching staff, which I think is one of the best in the nation," Bulldogs right fielder Hunter Renfroe said, "we didn't do what we were supposed to do. We didn't put up run support like we should have."
Bulldogs starter Luis Pollorena (6-4) lasted one inning. Jonathan Holder, the closer, came on with one out in the fourth inning and went the rest of the way.
UCLA allowed four runs in five games to set a CWS record for fewest in the metal-bat era that started in 1974.
The Bruins' .227 batting average in the CWS also was the lowest since teams went away from wooden bats. Their 19 runs in five games were the fewest by a champion since the CWS went to eight teams in 1950.
After Arizona's title last year, the Pac-12 has now won two straight and 17 titles overall in baseball - the most of any conference.
Mississippi State was playing for its first national title in a team sport and was the sixth straight Southeastern Conference team to make it to the finals.
"What we did was knock on the door, and UCLA has knocked on the door before and they knocked down the door, and we didn't do that," Bulldogs coach John Cohen said. "It bothered me we didn't play well the last two days. We played 15 postseason games and didn't play well in two of them."
Vander Tuig, who won his fourth straight postseason start, gave up just one earned run in 21 1-3 innings over his last three outings.
"I think back on all the experience I've had in three years and how it really helped me," Vander Tuig said. "I also think of just how many wins this team has had and the opportunities we've had. It's what has gotten me to where I am, trying to keep things simple, making pitches and letting my defense work."
The Bruins won their first title in their third CWS appearance in four years and fifth all-time. They had made it to the finals in 2010 and were swept by South Carolina. Last year they went 1-2 in Omaha.
This season they finished third in the Pac-12, behind Oregon State and Oregon, and then got hot in the postseason.
They made magic with an offense that started Tuesday 264th out of 296 teams in batting (.247) and 215th in scoring (4.7 runs per game), but was among the national leaders in sacrifices, walks and hit batsmen.
UCLA won three straight at home in the regionals and went on the road to upset No. 5 national seed Cal State Fullerton in a two-game super regional.
Once the Bruins got to Omaha, they made themselves at home in spacious TD Ameritrade Park. UCLA produced just enough offense to support its superb pitching and defense in bracket play, and again in Game 1 of the finals.
The pitching and defense showed up again in Game 2, and this time so did the offense.
"We've been capable all season long," Savage said. "We have good players. I said that all along. They started to believe, and they used the whole field. Fortunately, we had some hits tonight."
UCLA was up three runs early - a lead that has been insurmountable for every team in this year's CWS.
The Bruins used a hit batsman, a bunt that produced two Mississippi State errors, and Filia's sacrifice fly to lead 1-0 in the first. It was 3-0 in the third after Brian Carroll scored on a safety squeeze bunt by Filia and Pat Valaika's RBI single.
By the time the Bulldogs were forced to call on Holder, it was pretty much game over.
"As far as Mississippi State goes, they'll be back," Bulldogs shortstop Adam Frazier said. "Coach Cohen is doing the right things, the coaching staff has it going in the right direction. I trust coach Cohen will get it to what it is supposed to be, and I've got a feeling this team will be back in the future."
NORTH ATTLEBOROUGH, Mass. (AP) -- New England Patriots tight end Aaron Hernandez was taken from his home in handcuffs Wednesday morning, more than a week after a Boston semi-pro football player was found dead in an industrial park a mile from the player's house.
Odin Lloyd, a 27-year-old semi-pro football player for the Boston Bandits, was found slain June 17. His relatives said he was dating the sister of Hernandez's fiancee, that the two men were friends and that both men were out together on the last night of Lloyd's life.
Officials ruled the death a homicide but did not say how Lloyd died.
It's unclear why Hernandez was being taken into custody Wednesday around 9 a.m. and put into the back of a police cruiser. He was wearing a white V-neck T-shirt, with his arms inside the shirt and behind his back. He casually spit into some bushes on his way to the car.
The Associated Press emailed a message to his attorney, Michael Fee, who hasn't discussed the investigation beyond acknowledging media reports about it. A message also was left with the Bristol County district attorney's office.
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.
Reporters have been camped out for days at Hernandez's sprawling home on the Rhode Island line, not far from the stadium where the Patriots play. They reported Tuesday that Hernandez got a visit from Boston defense attorney James Sultan.
The Patriots drafted Hernandez, who is originally from Bristol, Conn., out of the University of Florida in 2010. Last summer, the team gave him a five-year contract worth $40 million.
Patriots spokesman Stacey James has said the team did not anticipate commenting publicly during the police investigation.