In his speech at the Republican convention in 2016, Donald Trump spoke of the mass shooting at a gay nightclub in Orlando, where a man with jihadist sympathies murdered 49 people. “As your president, I will do everything in my power to protect our L.G.B.T.Q. citizens from the violence and oppression of a hateful foreign ideology,” he said.

At the time, this sort of rhetoric was common among Trump and his allies, who fashioned themselves in the mold of European right-wing populists, demonizing Muslims as a threat to hard-won Western sexual freedoms. Perhaps the hottest ticket at that year’s Republican National Convention was an L.G.B.T.Q. party called Wake Up! where the Dutch politician Geert Wilders warned about Shariah law in front of a photo exhibition featuring skinny, shirtless boys in MAGA hats, called “Twinks for Trump.” The photographer behind that exhibition, a reactionary libertine named Lucian Wintrich, briefly served as the White House correspondent for the far-right website The Gateway Pundit.

Seven years later, as the battle against wokeness has supplanted the war on terror in the right-wing imagination, conservative sympathies are reversing. “Republicans are wooing Muslim voters by promising to protect them from L.G.B.T.Q. rights advocates whose demands conflict with their faith,” David Weigel reported in Semafor this week. The Fox News host Laura Ingraham, who once called for banning Muslim immigration from the Middle East, recently ran a sympathetic segment about Muslim parents in Maryland who want their kids to be exempt from reading books with L.G.B.T.Q. characters or themes. “Us Catholics and other Christians, other people of faith, have been waiting for the Muslims to step up on this issue,” Ingraham told her guest, a Muslim father and activist named Kareem Monib.

On Wednesday, a Gateway Pundit article celebrated the all-Muslim City Council in Hamtramck, Mich., which voted to ban all but five flags from flying on city property — a move widely seen as targeting Pride flags. “The revolt against the radical L.G.B.T.Q.I.+ takeover of the U.S. won another battle this week,” the article crowed.

This nascent alliance between conservative Christians and Muslims marks the resurrection of a right-wing project that was derailed, for a time, by the Sept. 11 attacks. Back in the 1990s, American conservatives founded a group called the World Congress of Families in an effort to unite pious traditionalists from across the globe against the forces of secular modernity. Before the attacks on the World Trade Center, they’d been planning simultaneous conferences in Mexico City and Dubai. After the attacks, those plans fell apart and cooperation between right-leaning Christians and Muslims became more fraught, though it continued in international bodies like the United Nations.

In the United States, some conservative Christians held on to the possibility of an alliance with conservative forces in Islam. The influential activist Grover Norquist has been doing Muslim outreach for decades. Before he was a major stolen-election conspiracy theorist, the right-wing propagandist Dinesh D’Souza expressed his preference for Islamic radicalism over Western liberalism in his book “The Enemy at Home.”

But at a time when abhorrence of Islam was an organizing principle of the Republican right, such reactionary ecumenism was unpopular. Some of Norquist’s fellow conservatives even smeared him, absurdly, as a Muslim Brotherhood mole, and nearly got him removed from the board of the National Rifle Association.

Now, however, the backlash against what’s sometimes called gender ideology is so strong that it’s creating space for strange new political bedfellows. Consider, for example, the political journey of the writer Asra Nomani.

A former foreign correspondent, Nomani had been close to Daniel Pearl, The Wall Street Journal reporter murdered by terrorists in Pakistan in 2002. After his killing, she became prominent as a Muslim critic of Islamic fundamentalism. In 2004, The New York Times wrote about her “Rosa Parks-style civil disobedience” in refusing to leave the men’s section of a mosque. She co-wrote a Washington Post column denouncing the hijab as the product of an ideology that “absolves men of sexually harassing women and puts the onus on the victim to protect herself by covering up.” When Nomani, a self-described liberal Democrat, voted for Trump in 2016, she described it, in part, as a vote against Islamic extremism.

So I was a little surprised when I saw that Nomani, who lives in Virginia, had joined a protest last week organized by the Muslim parents Ingraham lauded. In 2015, Nomani treated Muslim demands for a school holiday on Eid al-Adha as an example of “creeping Shariah.” Now she was aligning with parents who insisted that their kids be allowed to opt out of school assignments that went against their religious values. But what seemed like an obvious contradiction to me made perfect sense to her: Once again, she saw herself struggling against a malign and totalizing ideology. Wokeism, she told me, “is more of a danger to all of our societies than Islamism. Especially when it comes to the kids.” Islamism, she said, “is not seeping into our K-12 system. But wokeism is.”

Nomani described “bonfire potlucks” in Virginia where “Muslim parents are starting to speak with religious Christian conservative parents.” Were it not inspired by an anti-L.G.B.T.Q. backlash, such interfaith dialogue would be touching. History shows us, however, that nothing drives conservatives to reach out to groups they once feared as much as another group that they fear even more.