This post is part of Outward, Slate’s home for coverage of LGBTQ life, thought, and culture. Read more here.

On Wednesday, the New Hampshire Senate passed a landmark bill outlawing discrimination against transgender people in housing, employment, and public accommodations. The state House of Representatives has already passed the measure, and Gov. Chris Sununu has confirmed his intent to sign it. What’s remarkable about this victory is that Sununu is a Republican, and both houses of the state legislature are controlled by the GOP. Democrats pushed hard for the bill and supported with near-unanimity. But it was Republican legislators who carried it over the finish line.

This bipartisan triumph for transgender equality contrasts sharply with Donald Trump’s unrelenting assault on transgender rights. Indeed, it should be been seen as a rebuke to his persistent attacks on LGBTQ Americans. The Trump administration has revoked federal guidance protecting transgender students, employees, and homeless people. It is poised to attempt to repeal nondiscrimination protections for transgender patients under the Affordable Care Act. And, of course, it is striving to ban open transgender military service by arguing that trans people are mentally unstable deviants. Vice President Mike Pence and Attorney General Jeff Sessions are the driving force behind the onslaught: Pence intervened behind the scenes to overrule Secretary of Defense James Mattis’ support for trans service, while Sessions has issued a stream of directives designed to undermine LGBTQ rights under federal law.

New Hampshire Republicans are not entirely immune to the anti-trans animus that grips the Trump administration. Just last year, Republicans in the state House defeated the same trans non-discrimination bill by a slim margin, expressing concern about the “bathroom predator” myth—the canard that sexual predators will exploit these laws to abuse women and children. LGBTQ advocates responded with more appeals to empathy, bringing some of the state’s 4,500 transgender residents to the legislature to explain why they need legal protections. This strategy worked: About fifty Republicans voted with Democrats to pass the bill by a 195–129 vote in the House, and four Republicans voted with Democrats in the Senate to clear the bill by a 14–10 margin.

New England Republicans, of course, tend to be more moderate than the average GOP politician in Congress. And New Hampshire’s lawmakers pride themselves on their support for individual liberty; when a faction of anti-gay Republicans attempted to repeal the state’s marriage equality law in 2012, dozens of their GOP colleagues voted against the measure, scuttling it in a rout. But as last year’s failed effort to protect transgender people illustrates, securing Republican votes for LGBTQ bills still isn’t easy. Advocates at Freedom New Hampshire and the New Hampshire ACLU had to convince skeptical legislators that expansive non-discrimination protections for gender minorities are good policy and good politics.

Their success proves that Pence and Sessions’ anti-trans extremism is increasingly anachronistic in contemporary politics—and even, perhaps, in today’s Republican Party. Multiple GOP governors have signed bills banning LGBTQ “conversion therapy;” a coterie of moderate Republicans blocked Texas’ anti-trans bathroom bill; and Republican senators have spoken out in opposition to the trans troops ban. Democrats remain the unmistakable champions of LGBTQ rights, but not all Republicans are as viciously anti-trans as the Trump administration. Pence and Sessions are relics—they may hold power right now, but they see their hardline views losing favor, hence the mad dash to enshrine as many into law as possible. They may win a few more battles. But as New Hampshire demonstrates, they’re likely doomed to lose this war.