The Senate may struggle to pass legislation this summer that would protect LGBTQ rights. Currently, the Equality Act has no Republican support in the chamber. This is perhaps unsurprising, given recent GOP-led efforts to pass state laws targeting LGBTQ people.

Yet for nearly half a century, LGBTQ Republicans have worked on behalf of the GOP despite the party’s general indifference (and often hostility) to their presence and their rights as Americans. Although most Republicans spurned or scorned LGBTQ Americans, former president Donald Trump made softer rhetoric on LGBTQ issues part of his political strategy.

In fact, Trump’s initial foray into conservative and Republican politics came at the 2011 annual meeting of the Conservative Political Action Conference (CPAC) — at the invitation of GOProud, an LGBTQ Republican organization.

Trump’s connection to LGBTQ voters built upon a smaller, often overlooked tradition of Republican politicians pursuing queer support and backing LGBTQ rights as part of their strategy to win. These politicians usually hailed from places not dominated by the GOP. They ran as very different types of Republicans, particularly as the GOP became increasingly hostile to LGBTQ rights beginning in the 1990s. What made Trump different, however, was his ability to make his LGBTQ-friendly reputation into an asset — or at least not a deficit — on the national stage, the very thing that blue-state Republicans seeking their party’s presidential nomination had failed at in the past.

In the late 1970s, LGBTQ Republicans began forming small organizations called Lincoln Clubs and Log Cabin Clubs to work against anti-gay ballot initiatives springing up nationwide. They also wanted to show the GOP that they, not the new coalition of religious conservatives behind the anti-LGBTQ efforts, were the real embodiment of Republican values and an untapped resource for the party — potential difference makers in tight races. In 1977, an LGBTQ Republican activist told the California State Republican Convention that the party was losing close elections because it was ignoring 2.5 million LGBTQ voters in the state. Five years later, a leader of the Log Cabin Club of Los Angeles said he could deliver as many as 200,000 LGBTQ voters for the party, if only the GOP would show a little interest.

Some Republican politicians took notice. Especially in California, where LGBTQ Republicans tended to be libertarian in their politics, moderate candidates such as George Deukmejian, elected governor in 1982, and Roger Hedgecock, who won San Diego’s mayoral race one year later, courted queer voters as part of their winning coalitions. Hedgecock especially reached out to gay voters; his campaign slogan, “Mayor for all San Diegans,” suggested that he planned to bring tolerant politics to a conservative town.

Following Hedgecock’s narrow victory, observers pointed to his strong showing in San Diego’s LGBTQ neighborhoods along with the $40,000 that LGBTQ donors had given to his campaign and the extensive canvassing that queer volunteers had done as key factors. “I don’t think we could have won without it,” one of Hedgecock’s advisers later told the Los Angeles Times. San Diego’s LGBTQ leaders estimated that of the city’s 100,000 queer residents, at least 35,000 could be characterized as “very concerned” voters, a number that could help shift a race. In addition to his direct appeal to them, Hedgecock’s campaign to stop the “Los Angelization” of San Diego probably also attracted middle-class LGBTQ homeowners concerned about the city’s overdevelopment.

Hedgecock’s outreach to the LGBTQ community provided a model for how other moderate Republicans could run in California, especially as the state began to trend less-Republican in the late 1980s. Seeking reelection in 1988, Sen. Pete Wilson met with LGBTQ Republicans and promised to support gay rights, including anti-discrimination ordinances and greater protections for people with HIV/AIDS. “This is the first time we have [a] clear statement by a leader of the Republican Party that this is a party that stands for inclusion,” said Frank Ricchiazzi, founder of the Log Cabin Club of Orange County.

But that brief sign of inclusion was overshadowed by the increasing power of White evangelicals within the GOP — even in places such as California that weren’t Southern religious strongholds. Religious conservatives used the unfolding HIV/AIDS crisis to justify anti-LGBTQ politics and try to eject queer Republicans from the party. In 1987, a faction of religious conservatives tried unsuccessfully to have the California Republican Party revoke the Log Cabin Club’s charter. Three years later, religious conservatives, now in control of the state party’s leadership, passed a resolution that the California GOP would not recognize any groups “based on sexual orientation.”

These local actions mirrored what was taking place nationally. At the 1992 Republican National Convention in Houston, almost half of the delegates identified as evangelical Christians. They lustily cheered a stream of anti-gay rhetoric. The convention platform, one of the most conservative ever produced, took an absolutist position against LGBTQ rights, including opposition to “any legislation or law which legally recognizes same-sex marriages.”

Surprisingly perhaps, opposing LGBTQ rights “galvanizes our public more than right to life,” the Traditional Value Coalition’s president Lou Sheldon told The Washington Post. “It is absolutely a vital issue to Bible-believing Christians.” Republican politicians got the message. In red states and especially at the national level, firm opposition to LGBTQ rights became a standard GOP position.

Yet the dwindling number of centrist Republicans running for office, primarily in the northeast, took a very different tact. Candidates such as William Weld and later Mitt Romney, both in Massachusetts, and Christine Todd Whitman in New Jersey, won governorships by running as social liberals and fiscal conservatives. Rudolph W. Giuliani became the first Republican mayor of New York City in almost three decades after speaking out against anti-LGBTQ violence and voicing support for teaching tolerance of sexual diversity in the city’s public schools. In the Senate, Lincoln Chafee of Rhode Island and Maine’s Olympia Snowe and Susan Collins provided solid support for most LGBTQ rights. The three even earned occasional endorsements from the Human Rights Campaign, the nation’s largest LGBTQ advocacy organization.

All of these Republicans benefited from heavy LGBTQ support for their campaigns. Weld may have even won his 1990 race because of it. With a margin of just 75,000 votes, Weld’s estimated 160,000 LGBTQ supporters compared to only 60,000 for his Democratic opponent was seen as determinative. The LGBTQ vote “was key to the election,” Weld’s chief fundraiser told the Boston Globe. “It almost hinged on this margin.”

Beyond attracting LGBTQ voters, blue-state Republicans used their LGBTQ-friendly image along with pro-abortion rights and pro-gun control positions to appeal to suburban moderates, independents and even some Democrats. National media hailed these tactics as a smart way for GOP candidates to win in Democratic-leaning states, and the Republican Party frequently showcased blue-state Republicans to prove the GOP’s diversity and show that the party could win anywhere.

But when these politicians jumped to the national level, their LGBTQ-friendly reputations threatened to disqualify them with the GOP’s White evangelical base. Those with presidential ambitions, such as Romney and Giuliani, adjusted accordingly. Vying for the Republican presidential nomination in 2008, the two attacked each other for supporting LGBTQ rights while trying to distance themselves from their own records. Guiliani “is pro-choice … pro-gay marriage, and anti-gun,” Romney told the Christian Broadcasting Network. A Giuliani campaign official fired back. “It’s sad … [Romney] can’t keep his own positions straight let alone Rudy’s.”

Unlike Romney and Giuliani, having never served in public office, Trump had no political record to disavow or explain to conservative voters. Running after the legalization of same-sex marriage and as the nation became significantly more supportive of LGBTQ rights, Trump intuitively seemed to understand that Republicans had become more animated by the nation’s shifting racial demographics and immigration than they were by the question of LGBTQ rights. Regarding same-sex marriage, Trump considered it settled law rather than something to stir up the base. “And I’m fine with that,” he told CBS’s Lesley Stahl.

Still, even as he actively sought queer support, Trump gave little indication that he would actually do anything to advance LGBTQ rights. That made it easier for him to also cozy up to White evangelicals, who correctly viewed his politics as highly malleable. Indeed, once in the White House, Trump’s administration carried out a steady assault on LGBTQ rights, especially against transgender people, a reflection of the transactional nature of Trump’s politics. And of course LGBTQ immigrants and people of color suffered from Trump’s policies.

Trump viewed White evangelical support as more important than support from LGBTQ Americans or even LGBTQ-friendly suburbanites. That dictated policies that pleased this key constituency, even if his talk occasionally sounded like the Northeastern moderates from places like his native New York. In that, Trump had found the new sweet spot of conservative politics: an LGBTQ-friendly rhetoric that matched the moment combined with a hard-line anti-LGBTQ policy agenda taken straight from the past. That agenda is at work today, as advocates try to find GOP support for legislation that will meaningfully protect LGBTQ rights.