(The Center Square) – The U.S. Senate voted Tuesday to pass a bill that would federally codify same-sex and interracial marriages.

A handful of Republicans joined Democrats in voting for the “Respect for Marriage Act,” which passed 61-36, and will now head to the House of Representatives.

“This Senate has passed the Respect for Marriage Act!” Democratic Leader Sen. Chuck Schumer, D-N.Y., said “Because no one should be discriminated against because of who they love.”

Though neither same-sex nor interracial marriages are currently illegal in any state, lawmakers sought to codify protections in federal law.

As The Center Square previously reported, U.S. Sen. Tammy Baldwin, D-Wisc., has helped lead the effort. Her office said the legislation would “require the federal government to recognize a marriage between two individuals if the marriage was valid in the state where it was performed.”

Notably, the bill would “guarantee that valid marriages between two individuals are given full faith and credit, regardless of the couple’s sex, race, ethnicity or national origin, but the bill would not require a State to issue a marriage license contrary to state law.”

The U.S. Supreme Court’s overturning of the landmark Roe v. Wade abortion ruling motivated this legislative effort as some Democrats said same-sex marriage protections the court ruled on during the Obama administration could be at risk.

The 2015 Obergefell v. Hodges precedent required states to allow same-sex marriages. Under the new law, in the event that Obergefell is overturned, states would be allowed to ban gay marriages but would have to recognize gay marriages that were performed in other states.

The legislation repeals the federal Defense of Marriage Act, but state laws preventing same-sex marriage are still on the books in some states and would take effect if Obergefell were ever overturned.

From the bill’s official summary:

Specifically, the bill repeals and replaces provisions that define, for purposes of federal law, marriage as between a man and a woman and spouse as a person of the opposite sex with provisions that recognize any marriage that is valid under state law (The Supreme Court held that the current provisions were unconstitutional in United States v. Windsor in 2013.) The bill also repeals and replaces provisions that do not require states to recognize same-sex marriages from other states with provisions that prohibit the denial of full faith and credit or any right or claim relating to out-of-state marriages on the basis of sex, race, ethnicity, or national origin. (The Supreme Court held that state laws barring same-sex marriages were unconstitutional in Obergefell v. Hodges in 2015; the Court held that state laws barring interracial marriages were unconstitutional in Loving v. Virginia in 1967.) The bill allows the Department of Justice to bring a civil action and establishes a private right of action for violations.

President Joe Biden torpedoed a similar hope among Democrats to codify abortion protections after the midterm elections, saying his party will not have the votes.