(Bloomberg) -- The Senate passed legislation to enshrine federal protection for same-sex marriages with a bipartisan vote that dramatically demonstrates the massive cultural shift in the US on the issue.

The 61-36 vote on Tuesday was a victory for Democrats who’ve raised concerns that the conservative-leaning Supreme Court could overturn a 2015 ruling that established the right to same-sex marriage.

“It’s a scary but necessary acknowledgment that despite all the progress we made, the constitutional right to same-sex marriage is not even a decade old and exists only by the virtue of a very narrow 5-4 Supreme Court decision,” said Senate Majority Leader Chuck Schumer. “And we all know the court has changed since that decision. As we have already seen this year what the court has decided in the past can be easily taken away in the future.”

The bill, named the Respect for Marriage Act, passed with 12 Republicans joining all Democrats present in support. The bill heads back to the House, where it’s expected to pass, because the Senate amended the legislation to provide religious liberty protections to meet demands from Republicans. The House passed an earlier version on a 267-157 bipartisan vote.

Speaker Nancy Pelosi said in a statement on Tuesday night that the House would vote next week. 

President Joe Biden, in a statement, praised the Senate vote on the measure. Once the House approves it, he said, “I will promptly sign it into law.”

The bill, sponsored by Senate Democrats Tammy Baldwin of Wisconsin and Dianne Feinstein of California as well as Maine Republican Susan Collins would repeal the Defense of Marriage Act which defined marriage as between a man and a woman under federal law. 

If the Supreme Court overturns its decision in Obergefell v. Hodges, the legislation would give federal recognition to same-sex marriages, but it wouldn’t require states to issue same-sex marriage licenses. However, states would be obligated to recognize marriage licenses issued in another state where those unions are legal regardless of sex, race, ethnicity or national origin.

It also affirms federal protections and benefits to interracial couples.

Baldwin and Collins worked alongside Democrat Kyrsten Sinema and Republicans Thom Tillis and Rob Portman to amend the original legislation to gain more GOP support. 

The new language ensures that the measure does not infringe on religious liberty and conscience protections. Non-profit religious organizations would not be required to provide services for any marriage celebration. It also prohibits the bill from being used to deny or alter benefits unrelated to marriage, such as a church or other nonprofit’s tax-exempt status.

“For the sake of our nation today and it’s survival we do well by taking this step. Not embracing or validating each other’s devoutly held views, but by the simple act of tolerating them,” said Republican Senator Cynthia Lummis of Wyoming.

Multiple religious groups, including the Interfaith Alliance, Anti-Defamation League and the Church of Jesus Christ of Latter-day Saints expressed support for the Respect for Marriage Act. 

Kelley Robinson, president of the Human Rights Campaign, an LGBTQ+ advocacy group, said Tuesday’s passage is a much-needed win for the LGBTQ+ community which has been subject to increasing extremist rhetoric.

“Passing this bill shows a true victory for our community, and one that really does show that at the highest levels of government, our humanity is respected, our dignity is respected, our love is respected,” Robinson said.

Company leaders have weighed in with their support.

David Solomon, the chief executive officer of Goldman Sachs Group Inc., which has supported same-sex marriage for many years, applauded the vote. “We have long advocated for marriage equality as one of the first companies to publicly call for same-sex marriage,” he said in a statement. “We look forward to the bill’s passage by the House of Representatives and signature by the president.”

Sundar Pichai, the CEO of Alphabet Inc.’s Google, tweeted his praise of a Senate vote earlier in November that advanced the legislation. 

Public opinion on same-sex marriage has changed significantly since the Defense of Marriage Act was signed into law. In 1996, a Gallup poll showed only 27% of Americans supported same-sex marriage and that figure has since increased to 71%, according to a June Gallup poll.

Portman said the bill brings the law into line with public sentiment.

Some Republicans criticized the bill as not going far enough to protect religious liberties, despite the added new language. And some raised doubt that the Supreme Court would actually move to overturn the Obergefell v. Hodges ruling.

“How we proceed today will do nothing to the status quo of same-sex marriage in this country,” Utah Republican Senator Mike Lee of Utah said Tuesday. “It’s legal and will remain legal regardless of the outcome of this legislation. It will however, if enacted, have profound consequences for people of faith.”

Democrats said it was necessary to pass legislation protecting the rights of same-sex couples after the Supreme Court overturned the 1973 Roe v. Wade decision that established a constitutional right to an abortion. In his concurring opinion on the case, Supreme Court Justice Clarence Thomas wrote that the court should review other “due process precedents,” including the 2015 Obergefell v. Hodges ruling. 

In 2013, the Supreme Court ruled in United States v. Windsor that the federal government cannot discriminate against married same-sex couples when determining benefits and protections. And Obergefell v. Hodges determined that all states are required to license same-sex marriages and recognize marriages legally performed in other states.

Civil rights groups pressed Congress to take quick action in case the ruling were to be overturned in the future.

--With assistance from Sridhar Natarajan.

(Updates with business leaders, starting in 16th paragraph.)

©2022 Bloomberg L.P.