The Supreme Court ruled Friday that same-sex couples have a right to marry nationwide, in a historic decision that invalidates gay marriage bans in more than a dozen states.
Gay and lesbian couples already can marry in 36 states and the District of Columbia. But in a 5-4 ruling, the court held that the 14th Amendment requires states to issue marriage licenses for same-sex couples and to recognize such marriages performed in other states.
The ruling means the remaining 14 states that did not allow such unions, in the South and Midwest, will have to stop enforcing their bans.
Justice Anthony Kennedy wrote the majority opinion, just as he did in the court's previous three major gay rights cases dating back to 1996.
"No union is more profound than marriage," Kennedy wrote, joined by the court's four more liberal justices.
He continued: "Under the Constitution, same-sex couples seek in marriage the same legal treatment as opposite-sex couples, and it would disparage their choices and diminish their personhood to deny them this right."
The outcome is the culmination of two decades of Supreme Court litigation over marriage, and gay rights generally. Cheers broke out outside the Supreme Court when the decision was announced.
President Obama tweeted: "Today is a big step in our march toward equality."
But other justices argued that the court should not be able to order states to change their marriage definition. Chief Justice John Roberts, in a dissent joined by Justices Clarence Thomas and Antonin Scalia, called the ruling an "extraordinary step."
"Many people will rejoice at this decision, and I begrudge none their celebration. But for those who believe in a government of laws, not of men, the majority's approach is deeply disheartening," they wrote.
"The majority's decision is an act of will, not legal judgment."
Each of the four dissenting justices also wrote a separate dissent.
The ruling will not take effect immediately because the court gives the losing side roughly three weeks to ask for reconsideration. But some state officials and county clerks might decide there is little risk in issuing marriage licenses to same-sex couples.
The cases before the court involved laws from Kentucky, Michigan, Ohio and Tennessee that define marriage as the union of a man and a woman. Those states have not allowed same-sex couples to marry within their borders and they also have refused to recognize valid marriages from elsewhere. They previously had their bans upheld by a federal appeals court.
Just two years ago, the Supreme Court struck down part of the federal anti-gay marriage law that denied a range of government benefits to legally married same-sex couples.
There are an estimated 390,000 married same-sex couples in the United States, according to UCLA's Williams Institute, which tracks the demographics of gay and lesbian Americans. Another 70,000 couples living in states that do not currently permit them to wed would get married in the next three years, the institute says. Roughly 1 million same-sex couples, married and unmarried, live together in the United States, the institute says.
The Obama administration backed the right of same-sex couples to marry. The Justice Department's decision to stop defending the federal anti-marriage law in 2011 was an important moment for gay rights and Obama declared his support for same-sex marriage in 2012.
The Associated Press contributed to this report.