This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

WASHINGTON (AP) — A celebratory crowd of thousands bundled up on a chilly Tuesday afternoon to watch President Joe Biden sign gay marriage legislation into law, a joyful ceremony that was tempered by the backdrop of an ongoing conservative backlash over gender issues.

“This law and the love it defends strike a blow against hate in all its forms,” Biden said on the South Lawn of the White House. “And that’s why this law matters to every single American.”

Singers Sam Smith and Cyndi Lauper performed. Vice President Kamala Harris recalled officiating at a lesbian wedding in San Francisco. And the White House played a recording of Biden’s television interview from a decade ago, when he caused a political furor by unexpectedly disclosing his support for gay marriage. Biden was vice president at the time, and President Barack Obama had not yet endorsed the idea.

“I got in trouble,” Biden joked of that moment. Three days later, Obama himself publicly endorsed gay marriage.

Lawmakers from both parties attended Tuesday’s ceremony, reflecting the growing acceptance of same-sex unions, once among the country’s most contentious issues.

Senate Majority Leader Chuck Schumer, D-N.Y., wore the same purple tie to the ceremony that he wore to his daughter Alison’s wedding. She and her wife are expecting their first child in the spring.

“Thanks to the millions out there who spent years pushing for change, and thanks to the dogged work of my colleagues, my grandchild will get to live in a world that respects and honors their mothers’ marriage,” he said.

House Speaker Nancy Pelosi told the crowd that “inside maneuvering only takes us so far,” and she thanked activists adding impetus with “your impatience, your persistence and your patriotism.”

Despite Tuesday’s excitement, there was concern about the nationwide proliferation of conservative policies on gender issues at the state level.

Biden criticized the “callous, cynical laws introduced in the states targeting transgender children, terrifying families and criminalizing doctors who give children the care they need.”

“Racism, antisemitism, homophobia, transphobia, they’re all connected,” Biden said. “But the antidote to hate is love.”

Among the attendees were the owner of Club Q, a gay nightclub in Colorado where five people were killed in a shooting last month, and two survivors of the attack. The suspect has been charged with hate crimes.

“It’s not lost on me that our struggle for freedom hasn’t been achieved,” said Kelley Robinson, president of the Human Rights Campaign. “But this is a huge step forward, and we have to celebrate the victories we achieve and use that to fuel the future of the fight.”

Robinson attended the ceremony with her wife and 1-year-old child.

“Our kids are watching this moment,” she said. “It’s very special to have them here and show them that we’re on the right side of history.”

The new law is intended to safeguard gay marriages if the U.S. Supreme Court ever reverses Obergefell v. Hodges, its 2015 decision legalizing same-sex unions nationwide. The new law also protects interracial marriages. In 1967, the Supreme Court in Loving v. Virginia struck down laws in 16 states barring interracial marriage.

The signing marks the culmination of a monthslong bipartisan effort sparked by the Supreme Court’s decision in June to overturn Roe v. Wade, the 1973 ruling that made abortion available across the country.

In a concurring opinion in the case that overturned Roe, Justice Clarence Thomas suggested revisiting other decisions, including the legalization of gay marriage, generating fear that more rights could be imperiled by the court’s conservative majority. Thomas did not reference interracial marriage with the other cases he said should be reconsidered.

Lawmakers crafted a compromise that was intended to assuage conservative concerns about religious liberty, such as ensuring churches could still refuse to perform gay marriages.

In addition, states would not be required to issue marriage licenses to same-sex couples if the court overturns its 2015 ruling. But they will be required to recognize marriages conducted elsewhere in the country.

A majority of Republicans in Congress still voted against the legislation. However, enough supported it to sidestep a filibuster in the Senate and ensure its passage.

Tuesday’s ceremony marks another chapter in Biden’s legacy on gay rights, which includes his surprise endorsement of marriage equality in 2012.

“What this is all about is a simple proposition: Who do you love?” Biden said then on NBC’s “Meet the Press.” “Who do you love and will you be loyal to the person you love? And that is what people are finding out is what all marriages at their root are about.”

A Gallup poll showed only 27% of U.S. adults supported same-sex unions in 1996, when President Bill Clinton signed the Defense of Marriage Act, which said the federal government would only recognize heterosexual marriages. Biden voted for the legislation.

By the time of Biden’s 2012 interview, gay marriage remained controversial, but support had expanded to roughly half of U.S. adults, according to Gallup. Earlier this year, 71% said same-sex unions should be recognized by law.

Biden has pushed to expand LGBT rights since taking office. He reversed President Donald Trump’s efforts to strip transgender people of anti-discrimination protections. His administration includes the first openly gay Cabinet member, Transportation Secretary Pete Buttigieg, and the first transgender person to receive Senate confirmation, Assistant Secretary for Health Rachel Levine.

__

Associated Press writer Seung Min Kim contributed to this report.