The Supreme Court ruled on Friday that the U.S. Constitution provides same-sex couples the right to marry, handing a historic triumph to the American gay rights movement.
The court ruled 5-4 that the Constitution's guarantees of due process and equal protection under the law mean that states cannot ban same-sex marriages. With the landmark ruling, gay marriage becomes legal in all 50 states.
Immediately after the decision, same-sex couples in many of the states where gay marriage had been banned headed to county clerks' offices for marriage licenses as officials in several states said they would respect the ruling.
President Barack Obama, appearing in the White House Rose Garden, hailed the ruling as a milestone in American justice that arrived "like a thunderbolt."
"This ruling is a victory for America," said Obama, the first sitting president to support gay marriage. "This decision affirms what millions of Americans already believe in their hearts. When all Americans are treated as equal, we are all more free."
The ruling, the culmination of a long legal fight by gay rights advocates, follows steady gains in public approval in recent years for same-sex marriage. It was not until 2004 that the Massachusetts became the first state to legalize gay marriage. But the decision may provoke fresh legal fights in some conservative, Republican-governed states.
Justice Anthony Kennedy, writing on behalf of the court, said the hope of gay people intending to marry "is not to be condemned to live in loneliness, excluded from one of civilization's oldest institutions. They ask for equal dignity in the eyes of the law. The Constitution grants them that right."
"Without the recognition, stability and predictability marriage offers, their children suffer the stigma of knowing their families are somehow lesser," Kennedy wrote.
Kennedy, a conservative who often casts the deciding vote in close cases, was joined in the majority by the court's four liberal justices.
Appointed by Republican President Ronald Reagan in 1988, Kennedy has now authored all four of the court's major gay rights rulings, with the first in 1996.
The ruling is the Supreme Court's most important expansion of marriage rights in the United States since its landmark 1967 ruling in the case Loving v. Virginia that struck down state laws barring interracial marriages.
At least two states, Louisiana and Mississippi, said they would not immediately issue marriage licenses to same-sex couples while awaiting legal formalities. Supreme Court rulings generally take 25 days to go into effect.