WASHINGTON — Minnesota Democrats helped make history Thursday with their support of a measure that will put into federal law protections for the marriages of same-sex and interracial couples.

Lawmakers quickly rallied around the effort on Capitol Hill in a bipartisan embrace of equality for same-sex couples, marking a new chapter on an issue that was once far more politically divisive nationwide.

"Today really alleviates a lot of fear among same-sex married couples that an activist, extremist Supreme Court could take those rights away," said Democratic U.S. Rep. Angie Craig, who in 2018 became the first openly gay person elected to Congress from Minnesota. "It's a little surreal to be here voting to enshrine my own marriage, and those of millions of Americans, into law."

The House passed the legislation by a vote of 258 to 169, with every Minnesota Democrat voting in favor. Democratic President Joe Biden is a vocal supporter, and his signature will be the final step in the latest bipartisan victory during his time in office before Republicans take control of the House early next year.

"Congress took a critical step to ensure that Americans have the right to marry the person they love," the president said in a statement. "The House's bipartisan passage of the Respect for Marriage Act — by a significant margin — will give peace of mind to millions of LGBTQI+ and interracial couples who are now guaranteed the rights and protections to which they and their children are entitled."

While many Republicans voted no, 39 House Republicans backed the bill, including Minnesota U.S. Rep. Tom Emmer. The incoming House majority whip also voted for an earlier version of the bill in July, breaking with fellow Minnesota Republicans.

Emmer's office did not comment on his decision.

The bill requires all states to recognize same-sex marriages. It became a priority on Capitol Hill amid worry that an emboldened conservative majority on the U.S. Supreme Court could eventually discard an earlier decision legalizing same-sex marriage nationwide.

The legislation that Biden will sign into law does not force states to allow same-sex couples to marry, as the Supreme Court's 2015 Obergefell v. Hodges decision now does. It does, however, require states to recognize all marriages that were legal where they were performed and it would protect current same-sex unions if the Obergefell decision is overturned.

The Supreme Court overturned Roe v. Wade in June, ending decades of federal abortion rights.

"With the balance on the Supreme Court, and some of the things that are happening over there right now, I think families all over the United States needed to have this assurance that their marriage was protected, and that they were respected," Democratic U.S. Rep. Betty McCollum said during the House vote.

Minnesota Republican representatives Pete Stauber, Michelle Fischbach and Brad Finstad voted against the bill. All three declined to explain their votes as they hurriedly left the House.

Most Republicans opposed the legislation, and some conservative advocacy groups lobbied aggressively against it in recent weeks, arguing that it doesn't do enough to protect those who want to refuse services to same-sex couples.

"God's perfect design is indeed marriage between one man and one woman for life," said U.S. Rep. Bob Good, R-Va., ahead of the vote. "And it doesn't matter what you think or what I think; that's what the Bible says."

Democrats in the Senate worked with supportive Republican senators to address those GOP concerns by negotiating changes to clarify that the legislation does not affect the current rights of private individuals or businesses. The amended bill would also make clear that a marriage is between two people, an effort to ward off some far-right criticism that the legislation could endorse polygamy.

Minnesota Democratic U.S. senators Amy Klobuchar and Tina Smith supported the bill when it passed that chamber last week.

Compromises are never comfortable, Democratic U.S. Rep. Ilhan Omar said after the bill passed, but they're necessary.

"There are a lot of things that are personal that we vote on," Omar said. "But nothing as personal as being allowed to love who you love and being able to be with the person you want to be with."

The Biden administration had noted in an earlier statement that the bill "would repeal the Defense of Marriage Act, an unconstitutional and discriminatory law, and would enshrine the right to Federal recognition of marriage for same-sex and interracial couples."

Democrats have little time left to pass their priorities before Republicans start running the House next month. But it was clear that getting the marriage bill to the president's desk was an urgent goal.

"I have a daughter who is gay, and I want her to be able to marry whomever she wants," Minnesota U.S. Rep. Dean Phillips said in an interview earlier this week. "And I think I speak for parents around the country, grandparents, aunts, uncles, brothers and sisters who want nothing more for their loved ones than to enjoy the blessings of a committed relationship and marriage."

The Associated Press contributed to this report.