President Joe Biden signed the same-sex marriage bill into law Tuesday, as thousands assembled on the White House South Lawn to watch.
"Today is a good day," Biden told the crowd. He also called the legislation "a blow against hate."
The House of Representatives had passed the bill, known as the Respect for Marriage Act, on Thursday, giving federal protections to same-sex and interracial marriage.
The measure requires states to recognize legal marriages regardless of "sex, race, ethnicity, or national origin."
The bill already passed the Senate after a moderate amendment was added, offering a few protections for people who disagree with gay marriage because of their religious beliefs.
Several Republican senators offered stronger amendments protecting religious freedom, but those were voted down. That's why major concerns remain about future lawsuits against business owners and others who might object to supporting same-sex marriage.
The U.S. Supreme Court's 2015 decision already legalized those marriages nationwide
The House legislation, which passed 258-169, would also protect interracial unions, even though those were never in doubt, by requiring states to recognize legal marriages regardless of "sex, race, ethnicity, or national origin."
While the bill received some GOP votes, most Republicans opposed the legislation and some conservative advocacy groups lobbied aggressively against it, arguing that it doesn't do enough to protect those whose religious beliefs prohibit them from agreeing to provide services for same-sex couples.
"God's perfect design is indeed marriage between one man and one woman for life," said Rep. Bob Good (R-VA). "And it doesn't matter what you think or what I think, that's what the Bible says."
Rep. Vicky Hartzler (R-MO) choked up as she begged colleagues to vote against the bill, which she said undermines "natural marriage" between a man and a woman.
"I'll tell you my priorities," Hartzler said. "Protect religious liberty, protect people of faith and protect Americans who believe in the true meaning of marriage."
Democrats moved the bill quickly through the House and Senate after the Supreme Court's June decision that overturned the federal right to an abortion. That ruling included a concurring opinion from Justice Clarence Thomas that suggested same-sex marriage could also be reconsidered.
The House passed a bill to protect same-sex unions in July with the support of 47 Republicans, an unexpected show of support before the midterm elections that kick-started serious negotiations in the Senate. After months of talks, the Senate passed the legislation last week with 12 Republican votes.
House Speaker Nancy Pelosi (D-CA) presided over the vote as one of her last acts in leadership before stepping aside in January.
The legislation would not require states to allow same-sex couples to marry, as the Supreme Court's 2015 Obergefell v. Hodges decision now does. But it would 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 were overturned.
In a statement, First Liberty Institute President, CEO, and Chief Counsel Kelly Shackelford said, "Congress just passed a law that punishes the free exercise of religion. The so-called “Respect for Marriage Act” lets radical activists harass faith-based institutions in court because of their religious beliefs about marriage."
"No American should be punished for holding a faith-based view on marriage, even if that view conflicts with the government’s current preferred definition. And, no American should change their religious convictions about marriage just because a few politicians changed theirs," Shackelford added.