Lawmakers voted 267-157 to protect same-sex and interracial marriages amid concerns that the Supreme Court overturning Roe v. Wade could jeopardize other rights.
The US House passed a bill protecting same-sex and interracial marriages under law on Tuesday.
The Respect for Marriage Act is part of a push to legislate rights that could otherwise be overturned by the Supreme Court, following the repeal of Roe. v Wade abortion rights last month.
The vote saw 47 Republicans join all Democrats in supporting the bill, which was met with scattered applause on the House floor when it passed.
"For me, this is personal,'' said New York congressman Mondaire Jones, who is one of the few openly gay members of the House.
"Imagine telling the next generation of Americans, my generation, we no longer have the right to marry,'' he said. "Congress can't allow that to happen."
However, the bill still faces an uncertain future in the Senate, which is evenly split between Democrats and Republicans.
The fallout from Roe v. Wade
The proposed Respect for Marriage Act would replace the Defense of Marriage Act from 1996, which defined marriage as being between a man and a women.
Although the Supreme Court voted to strike down part of the act that specified gender in 2015, the law nevertheless remains on the books.
And after the Supreme Court recently voted to repeal its Roe v. Wade ruling that granted federal abortion rights in 1973, lawmakers on both sides of the debate saw gay marriage as the next potential legal flashpoint.
Texas Republican Senator Ted Cruise echoed this sentiment on Saturday, saying the Supreme Court was "clearly wrong" in allowing gay marriage back in 2015.
Democrats say this is why such rights should be legislated in Congress going forward.
"The extremist right-wing majority on the Supreme Court has put our country down a perilous path," Pennsylvania congresswoman Mary Gay Scanlon said.