The US Supreme Court has ruled that same-sex marriage is a legal right across the United States.
In a landmark 5-4 decision, Justice Anthony Kennedy writing for the majority ruled that marriage is a constitutional right for all.
"No union is more profound than marriage,'' he wrote, backed by the court's four more liberal justices.
It is unclear how soon marriage licences will be issued in states where gay unions were previously prohibited.
Writing one of the dissenting opinions, Chief John Roberts said the constitution "had nothing to do with it".
However, Christian conservatives decried the decision.
"We must resist and reject judicial tyranny, not retreat," said Mike Huckabee, Republican presidential candidate and former Arkansas governor.
Before the ruling on Thursday, gay couples could marry in 37 states in addition to Washington DC.
Now the remaining 14 states, in the South and Midwest, will have to stop enforcing their bans on same-sex marriage. Minutes after the ruling, couples in one of those states, Georgia, lined up to be wed.
Loud cheers erupted outside the court after the ruling was announced, said the BBC's Paul Blake at the Supreme Court.
Hundreds of people had camped out for hours awaiting the news.
One of the demonstrators, Jordan Monaghan, called his mother from his mobile phone amid the celebrations.
"Hey mom, I'm at the Supreme Court. Your son can have a husband now," Mr Monaghan said.
On social media, Democratic presidential candidate Hillary Clinton merely tweeted the word "proud" and the White House changed its Twitter avatar into the rainbow colours.
The case considered by the court concerned Jim Obergefell, an Ohio resident who was not recognised as the legal widower of his late husband, John Arthur.
"It's my hope that gay marriage will soon be a thing of the past, and from this day forward it will simply be 'marriage,'" an emotional Mr Obergefell said outside the court on Friday.
The first state to allow same-sex marriage was Massachusetts, which granted the right in 2004.
In recent years, a wave of legal rulings and a dramatic shift in public opinion have expanded gay marriage in the US. In 2012, the high court struck down a federal anti same-sex marriage law.