Democratic governments in the West are increasingly losing their bearings. From the shift toward illiberalism in Poland and Hungary to the Brexit vote in the United Kingdom and Donald Trump’s victory in the United States’ presidential election, a particularly lethal strain of populism is infecting societies – and it is spreading.

The appeal of populism is straightforward. Faced with stagnant wages and a declining quality of life, people feel frustrated – all the more so when their leaders keep telling them that things are getting better. Then the populist appears and promises to shake things up, to defend the interests of the “people” (though really only some of them), and offers something arguably more attractive than feasible solutions: scapegoats.

At the top of the list of scapegoats are the “elites” – established political parties and corporate leaders. Rather than protecting the “people” from economic pressure and insecurity, this group, the populist declares, thrives on the people’s pain. By advancing globalization – by forcing ever-more openness down the people’s throat – they have accumulated massive wealth, which they then protect through tax avoidance, offshoring, and other schemes.

But it is not just the elites who are blamed. Yes, they have betrayed the people. But one way they do so is by foisting upon the people equal rights and opportunities for minorities, immigrants, and foreigners, who “steal” jobs, threaten national security, and undermine traditional ways of life.

Trump won the US presidency partly because of his pledges to deport millions of undocumented immigrants and ban Muslims from entering the country. The Brexiteers promised to end free immigration from the European Union. After the vote, Britain’s Home Secretary Amber Rudd suggested that firms hiring foreigners should be named and shamed.

Today’s populism advances a toxic new xenophobia, one that threatens to fracture our societies. For politicians, it offers an easy means of quickly transforming people’s fear and powerlessness into an intoxicating mix of anger and authority. It persuades intimidated (often elderly) voters that, in the parlance of the Brexiteers, they can “take back control” of their lives and their countries, primarily by rejecting foreigners.

Demography makes the new xenophobia particularly dangerous. In much of the West, societies are becoming increasingly diverse. Hispanics now account for 17.6% of the US population. One-third of Londoners were born outside the UK. In France, an estimated 10% of the population is Muslim. And an estimated 20% of Germany’s population have some immigrant background.

In this context, when politicians campaign for votes by advancing antagonistic and divisive identity politics, they sow the seeds of animosity, mistrust, and violence within their own societies. When candidates repeatedly call Muslims dangerous, for example, no one should be surprised by a surge in anti-Muslim hate crimes, as has occurred in the wake of both the Brexit vote and Trump’s victory. Such divided societies require a rising level of coercion and force to control.

Diversity should be a strength, one that helps societies to flourish. That is why it is so important to combat the new xenophobia. One way is by encouraging and enabling social mixing, interaction, and deliberation among diverse groups. Extensive psychological research shows that intergroup contact reduces people’s sense of threat, heightening the possibilities for building trust across society.

If community centers, schools, and public locations are places where people of different religions, cultures, and race meet, xenophobia is less likely to take root. Even living in an area where others mix can help. This is why the new xenophobia has largely been resisted in Europe’s most diverse cities.

A second way to combat the new xenophobia is to reinforce the protection of civil liberties. This means upholding the rule of law, even in the face of terrorist threats, and ensuring the independence of judges.

Yet, lately, there have been ominous moves in the opposite direction. Leaders in Hungary and Poland have been dismantling constitutional protections; France has used a lengthy state of emergency to suspend rights; and British and American politicians have publicly denigrated judges. Democracy was toppled by xenophobes in the 1930s not because of the strength of the anti-democratic parties, but because of democratic leaders’ failure to uphold their countries’ constitutions.

A third way to fight the new xenophobia is through innovation. For example, though the Internet is often viewed as a great equalizer, social media are contributing to fragmentation. The content to which people are exposed is filtered, whether through self-selection or algorithms.

The result is echo chambers in which like-minded people reinforce shared convictions, creating increasingly polarized silos. But, if social media platforms were reconfigured in innovative ways, they could have the opposite impact, creating spaces for citizens from diverse backgrounds to interact.

The threat posed by the new xenophobia should not be underestimated. Today, no less than in the past, the rejection of diversity is tantamount to the rejection of democracy. That is why it must be defended, before its opponents gain any more ground.