The U.S. House on Thursday gave final approval to a same-sex marriage bill, sending it to President Joe Biden for his signature.

The Respect for Marriage Act cleared the House over the summer with the help of 47 Republicans. The bill returned to the House after the Senate added an amendment that protects religious liberty.

Thursday's vote saw a loss of 8 GOP votes. The legislation was a priority for the House majority after Democrats lost control of the House in the midterms.

The bill now heads to Biden's desk for his signature. Biden has expressed his support for the measure, saying last week that he will “proudly sign it into law.”

The Human Rights Campaign (HRC), the nation's largest LGBTQ rights advocate, called Thursday's vote “a clear victory” for same-sex married couples.

“Today’s vote in the House of Representatives sends a clear message: love is winning,” HRC President Kelley Robinson said in a statement. “At a time when the LGBTQ+ community continues to face ongoing attacks – from deadly violence to legislative assaults on our rights – today’s vote is a clear victory for this country’s 568,000 same-sex married couples, including me. The fact that this bill passed with strong bipartisan support in both chambers proves that marriage equality is supported by a wide swath of the American people. We eagerly await the president’s signature on this important legislation – and look forward to continuing to fight for full equality for everyone in our community, without exception.”

The Respect for Marriage Act codifies 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 will strengthen protections on a federal level and require states to recognize all legal out-of-state marriages.

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