UPDATED: June 26, 2015 2:08 p.m.

WASHINGTON (CBSDC/AP) — The Supreme Court declared Friday that same-sex couples have a right to marry anywhere in the United States.

Gay and lesbian couples already could marry in 36 states and the District of Columbia. The court’s 5-4 ruling means the remaining 14 states, in the South and Midwest, will have to stop enforcing their bans on same-sex marriage.

Gay rights supporters cheered, danced and wept outside the court when the decision was announced.

The outcome is the culmination of two decades of Supreme Court litigation over marriage, and gay rights generally.

In the majority opinion, Justice Anthony Kennedy wrote that same-sex marriage must be allowed under the United States Constitution.

“No union is more profound than marriage,” Kennedy wrote, joined by the court’s four more liberal justices.

“From their beginning to their most recent page, the annals of human history reveal the transcendent importance of marriage. The lifelong union of a man and a woman always has promised nobility and dignity to all persons, without regard to their station in life. Marriage is sacred to those who live by their religions and offers unique fulfillment to those who find meaning in the secular realm. Its dynamic allows two people to find a life that could not be found alone, for a marriage becomes greater than just the two persons. Rising from the most basic human needs, marriage is essential to our most profound hopes and aspirations,” Kennedy wrote.

Plaintiff in SCOTUS Same-Sex Marriage Case and Partner Married on BWI Airport Tarmac in 2013

Kennedy also wrote the court’s previous three major gay rights cases dating back to 1996. It came on the anniversary of two of those earlier decisions.

As Kennedy read his opinion, spectators in the courtroom wiped away tears after the import of the decision became clear. One of those in the audience was James Obergefell, the lead plaintiff in the Supreme Court fight.

Outside, Obergefell held up a photo of his late spouse, John, and said the ruling establishes that “our love is equal.” He added, “This is for you, John.”

President Barack Obama placed a congratulatory phone call to Obergefell, which he took amid a throng of reporters outside the courthouse.

Kennedy was joined by the four liberal justices of the court: Ruth Bader Ginsburg, Sonia Sotomayor, Elena Kagan and Stephen Breyer.

Chief Justice John Roberts, along with Justices Samuel Alito, Antonin Scalia and Clarence Thomas dissented, and all wrote separate dissents.

Alito wrote, “Today’s decision usurps the constitutional right of the people to decide whether to keep or alter the traditional understanding of marriage.”

Roberts said gay marriage supporters should celebrate, but don’t celebrate the Constitution.

“If you are among the many Americans—of whatever sexual orientation—who favor expanding same-sex marriage, by all means celebrate today’s decision. Celebrate the achievement of a desired goal. Celebrate the opportunity for a new expression of commitment to a partner. Celebrate the availability of new benefits. But do not celebrate the Constitution. It had nothing to do with it,” Roberts wrote.

PHOTOS: Scene Outside SCOTUS After Historic Ruling In Favor of Gay Marriage Nationwide

Scalia wrote his dissent “to call attention to this Court’s threat to American democracy.”

“Today’s decree says that my Ruler, and the Ruler of 320 million Americans coast-to-coast, is a

majority of the nine lawyers on the Supreme Court. The opinion in these cases is the furthest extension in fact—and the furthest extension one can even imagine—of the Court’s claimed power to create “liberties” that the Constitution and its Amendments neglect to mention. This practice of constitutional revision by an unelected committee of nine, always accompanied (as it is today) by extravagant praise of liberty, robs the People of the most important liberty they asserted in the Declaration of Independence and won in the Revolution of 1776: the freedom to govern themselves,” Scalia wrote.

Thomas wrote, “Aside from undermining the political processes that protect our liberty, the majority’s decision threatens the religious liberty our Nation has long sought to protect.”

Obama called the ruling a “big step in our march toward equality.”

Today is a big step in our march toward equality. Gay and lesbian couples now have the right to marry, just like anyone else. #LoveWins — President Obama (@POTUS) June 26, 2015

In a statement in the Rose Garden, Obama said that justice arrived like a thunderbolt.

“This ruling is a victory for America,” Obama said.

The president thanked gay rights supporters who worked tirelessly for this cause.

“America’s a place where you can write your own destiny,” he said.

Democratic presidential candidate Hillary Clinton weighed in, calling the ruling a “historic victory for marriage equality.”

Proud to celebrate a historic victory for marriage equality—& the courage & determination of LGBT Americans who made it possible. -H — Hillary Clinton (@HillaryClinton) June 26, 2015

Republican presidential candidate Jeb Bush said in a statement that the Supreme Court should have allowed the states to decide.

“Guided by my faith, I believe in traditional marriage. I believe the Supreme Court should have allowed the states to make this decision. I also believe that we should love our neighbor and respect others, including those making lifetime commitments,” the former Florida governor said. “In a country as diverse as ours, good people who have opposing views should be able to live side by side. It is now crucial that as a country we protect religious freedom and the right of conscience and also not discriminate.”

Baltimore Woman Raises $43K on GoFundMe to Make Her Yard ‘More Relentlessly Gay’ After Complaint From Neighbor

D.C. Mayor Muriel Bowser celebrated the ruling saying the court’s recognition of same-sex marriage as a right in every state “affirms our democratic values, that each of us is equal.”

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.

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.

The decision in United States v. Windsor did not address the validity of state marriage bans, but courts across the country, with few exceptions, said its logic compelled them to invalidate state laws that prohibited gay and lesbian couples from marrying.

The number of states allowing same-sex marriage has grown rapidly. As recently as October, just over one-third of the states permitted same-sex marriage.

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.

(TM and © Copyright 2015 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2015 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)