The Supreme Court has ruled that same-sex marriage may now be performed in all 50 states, forcing the 13 states that had banned it to fall in line. Here, a gay marriage advocate waves a flag in front of the Supreme Court Building, June 25, 2015, in Washington. Mark Wilson/Getty Images

The United States Supreme Court made history Friday, when it ruled that same-sex couples can get married in all 50 states. There were two questions at hand. One, does the Constitution force states to marry same-sex couples? And two, does it require states to recognize same-sex marriages from other states? The court decided that states must marry same-sex couples under the 14th Amendment and recognize those marriages from other states.

Obergefell v. Hodges was a consolidation of six cases from four states where federal appeals courts upheld same-sex marriage bans: Kentucky, Michigan, Ohio and Tennessee.

The case's namesake, 48-year-old Ohioan Jim Obergefell, was in court all week ready to hear the decision. Obergefell married his terminally ill husband, John Arthur, in Maryland in 2013. When Arthur died three months later, an Ohio judge allowed Obergefell to be listed as a spouse on the death certificate. But the state appealed, and Ohio would have issued a new death certificate for Arthur showing him as "single" had it won the lawsuit, BuzzFeed reported.

Obergefell's name went on the case because he was the first to file. It also includes Tanco v. Haslam, DeBoer v. Snyder and Bourke v. Beshear.

The justices heard oral arguments in the case on April 28, though they gave little indication as to which way they were leaning. Justice Anthony M. Kennedy, seen as the key voter, said it was "difficult" for the court to change the traditional definition of marriage from one that's been used for millennia, the Washington Post reported. But he later said same-sex couples recognized the nobility of marriage and wanted to share in it.

About two-thirds of Americans expected the court to legalize same-sex marriage, according to a Public Religion Research Institute poll from earlier this month. The breakdown of various groups' opinions didn't show much divide: Democrats, Republicans and Independents as well as Catholics and Protestants thought the court would rule in favor of same-sex marriage.

They were more split on who should have the power to legalize same-sex marriage. About half of respondents said states should be responsible for the decision, and 41 percent said the issue should be handled on a national scale.

Same-sex marriage was legal in 37 states heading into Friday's announcement. Thirteen states banned it, among them Arkansas, Georgia, Louisiana, Mississippi, North Dakota and Texas.

Read the opinion here.