A bill that seeks to protect same-sex marriage cleared the U.S. Senate on Tuesday.

The Respect for Marriage Act was approved with a 61-36 vote.

The bill seeks to codify the Supreme Court's 2015 ruling in Obergefell that struck down laws and constitutional amendments that defined marriage as a heterosexual union, ushering in nationwide marriage equality. It would strengthen protections on a federal level and require states to recognize all legal out-of-state marriages.

The legislation cleared the House with the support of 47 Republicans over the summer but changes in the Senate means that it must return to the lower chamber before heading to President Joe Biden's desk for his signature.

Democrats, who lost control of the House in the midterms, are expected to move quickly while they remain in power.

The Human Rights Campaign (HRC), the nation's largest LGBTQ rights advocate, called Tuesday's vote “historic.”

“Today love won,” HRC President Kelley Robinson said in a statement. “This is a historic day, marking a much-needed victory for our community. The LGBTQ+ community has faced ongoing deadly violence, legislative assaults and constant threats – including the deadly shooting in Colorado Springs barely one week ago. Today, with the passage of the Respect for Marriage Act in the Senate – a historic moment that marks the first federal legislative win for LGBTQ+ equality in over ten years, since the repeal of Don’t Ask Don’t Tell – the 568,000 same-sex married couples in this country can breathe a sigh of relief that their marriages will be protected from future attacks.”

Robinson added that GOP support for the legislation proves that “marriage equality enjoys growing bipartisan backing, is supported by a wide swath of the American people and is not going anywhere.”

Democrats reintroduced the legislation after the Supreme Court overturned Roe v. Wade in June, pointing out that both decisions were based on the right to privacy.

Three GOP amendments which sought to protect the rights of religious institutions and others opposed to same-sex marriage were rejected by the Senate.