In the months leading up to Tuesday’s Senate special election in Alabama, Republican candidate Roy Moore cemented himself as one of the most virulently anti-LGBTQ candidates in U.S. history.

Queer voters faced the prospect of a man coming to power who compared LGBTQ rights to Nazism and claimed that homosexual conduct should be illegal. And Moore’s anti-LGBTQ views weren’t limited to words ― he actively worked against the community throughout his judicial career (he twice served as chief justice of the Alabama Supreme Court).

So it’s no surprise that queer people geared up for the special election and played a crucial role in helping Democrat Doug Jones sweep to victory.

Bloomberg via Getty Images Doug Jones at his victory party Tuesday night.

Early in the race, The Human Rights Campaign and Equality Alabama identified this political battle as one that held significant weight for queer Americans.

Representatives from both organizations told HuffPost that 60,000 Alabamians identify as LGBTQ ― a minority with enough voting power to swing the race in Jones’ direction (in the preliminary final vote, he led by about 20,700 votes).

“Because HRC already has an established presence in Alabama and thousands of supporters, that led HRC to making an early endorsement in this race and pour tremendous financial resources and staff time into his campaign,” Ben Needham, who heads the group’s push to expand LGBTQ equality in the South, told HuffPost.

On the ground in Alabama, HRC efforts included door-to-door and phone canvassing across Alabama to ensure LGBTQ voters would turn out on Election Day.

The organizations also partnered with the NAACP ― a crucial move, as black women played a major role in Jones’ Alabama victory.

“I think for so long politicians and people running for office have neglected the LGBTQ community because they view it as this kind of lighting rod ― especially in the South,” Equality Alabama Director Alex Smith told HuffPost. “Talking about LGBTQ issues can be a deal breaker and can lose elections immediately. But I think we’re seeing that change now ― we’re seeing that candidates who embrace equality are candidates who get elected.”

Bloomberg via Getty Images A sign at the Doug Jones victory rally.

Alabama state Rep. Patricia Todd (D), who identifies as a lesbian, told HuffPost Queer Voices Editor-at-Large Michelangelo Signorile on Wednesday that the role of HRC in mobilizing voters proved indispensable to Jones.

“It’s the first time that we’ve really seen a queer group that active in one campaign” in the state, she said on Signorile’s SiriusXM radio program.

In Alabama’s rural areas, she said, “A lot of queer folks do not vote because they think it’s pointless or doesn’t make any difference. I think last night we demonstrated that every vote counts and you have got to exercise your right to vote. It was just phenomenal.”

Todd added that a number of LGBTQ people she knows that she didn’t expect to vote for Jones wound up casting their vote for him.

“It’s just incredible to finally win one,” she said. “It can get kind of lonely down here ... and I think the LGBTQ community turned out in droves. Even some of our Republican LGBTQ folks voted for Doug.”

Taylor Hill via Getty Images Alabama state Rep. Patricia Todd, who identifies as a lesbian, reveled in fellow Democrat Doug Jones' Senate win.

Small, unaffiliated groups of LGBTQ people, like Alabama native William Thomas, organized and engaged in fundraising efforts to help Jones at a grassroots level. Thomas, along with a friend, organized a brunch that raised several thousand dollars for the Democrat’s campaign.

He told HuffPost that much of the activism among queer people was inspired by a collective outrage at the blatant anti-LGBTQ rhetoric coming from the Moore campaign.

“I think [Jones’ victory] proves that even in a conservative place like Alabama, that when there is an existential threat to LGBTQ people we will fight back and we will organize ― we will get boots on the ground and we will go out and defeat people like [Moore],” Thomas said. “A lot of people have been like, ‘Well, where does the LGBTQ movement go post-marriage equality?’ And I think it’s preventing these people from ever getting into office again -– these people that believe we aren’t human and we don’t have rights.”

Thomas added that he believes the real power to defeat anti-LGBTQ politicians comes from queer people being out, visible, and coalescing against threats to their community.

“I think it’s becoming clearer and clearer that we’re here to stay and that the people that are trying to eliminate us and silence us, that they’re dying off and their message isn’t getting out there and it’s not resonating with people outside of their group,” he said. “I think as long as we’re out there and telling out stories, it will be harder and harder to try and silence us.”