In recent months, a new party has entered the German left. The Sahra Wagenknecht Alliance (BSW), headed by two women with immigrant roots in the Middle East and North Africa (Sahra Wagenknecht and Amira Mohamed Ali), takes a punitive approach to immigration in service of ostensibly protecting progressive values — specifically integration.

Six years ago, the Alternative for Germany (AfD) party launched a similar strategy on the radical right. Lead candidate Alice Weidel, an out lesbian banker, also took a punitive approach to migration in service of traditionally progressive values. Weidel claimed to be protecting gay and lesbian Germans from the alleged threat of integration, despite her own party’s intolerance. And yet, the strategy worked. The party managed to become the first new party to enter German parliament since 1961.

What accounts for the consensus between two parties on opposite fringes of the political spectrum?

For the past 75 years, German policymakers have eschewed the very category of “race,” which they saw as a relic of the Nazi past. Steeped in accounts of biological hierarchy and genocide, “race” could play no function in building German democracy. And yet it did. The combination of racial and sexual anxieties proved especially potent in shoring up the bounds of the postwar West German nation that was the building block for today’s Germany, even as those who harnessed those anxieties — politicians, religious figures, media outlets, anti-immigration protesters — denied that they were thinking about race at all. Nevertheless, racism proved remarkably durable, on both sides of the country’s politics.

Consider the case of postwar migration. Between 1955 and 1973, the Federal Republic of Germany instituted a guest worker program to meet the labor needs of its growing industrial capitalist economy. Invited workers and refugees — mostly from southern Europe and Turkey, but also North Africa and as far off as South Korea — sought residence in West Germany beyond the initial period covered by the temporary visa program.

In response, successive administrations attempted to restrict residency or even “repatriate” the population of Turkish immigrants — while allowing European migrants to remain. In this context, many on the right and the left redrew German belonging along the lines of race and religion.

Center-right politicians began advocating for increased restrictions on the twin grounds of social incompatibility and strains on the welfare state — what became known as the “overforeignization thesis.” Center-left politicians agreed that migration after the end of recruitment in 1973 signaled a fundamental threat to economic stability and social coherence. They gained support from left-wing activists who worried that Islam’s apparent restrictions on women somehow threatened the gains of German women’s emancipation. Inextricably tied up in concerns about culture, sexuality, and gender, the racialization of “Muslim immigrants” gained traction across the political spectrum in the later decades of the 20th century.

But this form of racism was not preordained. LGBT Germans, for instance, did not see Islam as threatening. Until 1969, West Germany retained in full the Nazi law criminalizing all sexual contact between men. To escape surveillance and prosecution, some men with means traveled abroad to countries like Turkey, which had no such provisions until 1962 and where, even after their implementation, the laws were unevenly policed. Many believed Islam to be conducive to homoeroticism. It was only in the aftermath of the 1979 revolution in Iran — and the widely publicized yet often exaggerated execution of men there convicted of sodomy — that more gay and lesbian German activists, in tandem with their international counterparts, began to interpret Islam as increasingly homophobic.

This belief was also adaptable to extant anxieties. Racial and sexual politics collided after the unification of East and West Germany in 1990 and the collapse of Eastern European Communism, offering opportunities for the right and the left. Following a series of right-wing, racist attacks, activists like Black feminist and poet May Ayim argued that such patterns of violence reflected the enduring racism that pervaded German society.

Simultaneous attacks against queer and trans people brought many white LGBTQ activists in alliance with antiracist goals. Together, they pursued the broader promise of liberal democracy to secure new rights, such as equal partnership and anti-discrimination laws. Neo-Nazis and skinheads threatened the goals of this coalition.

Policymakers and mainstream media outlets were less willing to face the embedded bigotry in German society. They oscillated between describing violence as an individual, criminal behavior or as the growing pains of the East German democratic transition. Lawmakers also shifted attention elsewhere: in 1993, theypassed the “Asylum Compromise.” The new legislation, with cross-party support, dramatically curtailed the extensive, yet porous, conditions under which people could seek asylum in Germany. The problems of unification, politicians asserted, required both a strengthening of Germany’s borders and the prevention of right-wing violence.

This message resonated because some, mostly white LGBT activists saw immigration as threatening their goals just as Neo-Nazis and skinheads did.

Expanding protections for LGBT Germans, therefore, became an avenue through which sexualized fears of immigration were entrenched. The left argued that better integration measures aimed at dismantling Muslim homophobia were necessary to ensure democratic commitment to LGBT rights. Parties on the left backed urban education initiatives, such as the 2005 “Don’t be afraid of gays!” campaign, in which organizers placed posters in Berlin’s predominantly Muslim neighborhoods. Some queer Muslims countered that Islam held a variety of beliefs about homosexuality, and they should address issues, including racism and economic disparity, to ensure queer safety.

Meanwhile, center right politicians, who largely opposed LGBT rights, used the same logic to tighten citizenship requirements. Following the Dutch example, some German states proposed new “integration tests” that would require applicants to demonstrate acceptance of homosexuality. Members of the center-right federal government endorsed such initiatives, even if they never passed parliamentary approval.

In 2008, center right Berlin representative Sascha Steuer, who is gay, argued that the center left Berlin Mayor Klaus Wowereit (who is also gay) had fallen short on addressing homophobia by failing to communicate that those who do not embrace equality are not welcome in Germany. In 2014, center right representative Jens Spahn, who is also gay, argued that his Christian Democratic party could win over voters by offering solutions to the problem of “Turkish youth” attacking gay people on the streets of Berlin.

Even international media outlets platformed this rhetoric. In 2010, when out gay foreign minister Guido Westerwelle declined to bring his partner on state business to Saudi Arabia, a Financial Times opinion piece accused him of being an “appeaser,” in clumsy reference to the Nazi past, and claimed the episode was evidence that “Islamic states have been recently much more successful in spreading their values to the West than vice versa.”

From urban politics to foreign policy, the idea of Muslim homophobia has become a tool to shore up the political hardline.

When placed against the backdrop of 1970s center right “new social question” or 1990s center left asylum policy, the left-wing anti-immigrant policies of Sahra Wagenkneckt feel almost dated. So too does Alice Weidel’s right-wing promise to protect LGBT Germans, when placed alongside the politics of racism and nationalism that were present in the country’s gay-rights discourse. Together, they reveal that the politics of racism is both durable and highly adaptable, functioning not as curious exceptions, but as a core part of the German political calculus. As Dutch citizenship tests and Wall Street Journal op-eds hint, such politics easily bleed over national lines. We must therefore pay close attention to the pervasiveness of racism across the political spectrum, even if articulated through progressive causes.