WASHINGTON (CBSNewYork/AP) — The U.S. Supreme Court declared Friday that same-sex couples have a right to marry anywhere in the United States, in a ruling President Barack Obama described as “a victory for America.”

As CBS2’s Jessica Schneider reported, the decision sparked a celebration outside the Supreme Court, and a spontaneous rendition of the Star-Spangled Banner.

The historic court ruling brought hundreds to the court steps, and President Obama even called lead plaintiff James Obergefell to congratulate him.

“This decision affirms what millions of Americans believed,” Obama said. “When all Americans are treated more equal, we are all more free.”

Gay and lesbian couples could already 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.

WEB EXTRA: Read The Full Decision

Gay rights supporters cheered, danced and wept outside the court after the decision, which put an exclamation point on breathtaking changes in the nation’s social norms.

PHOTOS: Supreme Court Rules In Favor Of Same-Sex Marriage

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. It came on the anniversary of two of those earlier decisions.

“No union is more profound than marriage, for it embodies the highest ideals of love, fidelity, devotion, sacrifice, and family. … [The challengers] ask for equal dignity in the eyes of the law. The Constitution grants them that right,” Kennedy wrote, joined by the court’s four more liberal justices.

The stories of the people asking for the right to marry “reveal that they seek not to denigrate marriage but rather to live their lives, or honor their spouses’ memory, joined by its bond,” Kennedy said.

As he 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 lead plaintiff Obergefell.

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.”

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

“I just want to say congratulations, your leadership on this changed the country,” Obama told Obergefell.

Speaking a few minutes later at the White House, Obama praised the decision as “justice that arrives like a thunderbolt.”

"This ruling is a victory for America." —@POTUS on today's Supreme Court decision on marriage equality #LoveWins http://t.co/rG8PID2QIU — The White House (@WhiteHouse) June 26, 2015

Obama and Vice President Joe Biden also both took to Twitter to praise the decision.

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

All marriages at their root are about love. In America, our laws now recognize that simple truth. #LoveWins today & we couldn't be prouder. — Vice President Biden (@VP) June 26, 2015

New York City Mayor Bill de Blasio issued a statement calling the ruling “a pivotal moment in the history of our nation.”

“Today, this country is richer – filled with more equality, more acceptance, and more love than yesterday,” de Blasio said.

The mayor celebrated with a pop-up party Friday afternoon on the steps of City Hall, where he officiated two same-sex weddings, CBS2’s Steve Langford reported.

Sarah Joseph and Katrina Council, who met on a blind date at historic Stonewall Inn, were one of the two couples married by de Blasio.

Another couple got their marriage vows renewed.

“A feeling of sheer euphoric joy this morning — we’ve been fighting this battle for a long time,” said Jeffrey LeFrancois of Hell’s Kitchen.