For understandable reasons, Europeans are much more comfortable condemning the familiar anti-Semitism of the far right than the sort expressed by migrants entering Europe as the victims of war and economic deprivation. Nowhere is this issue more fraught than in Germany.

To a degree unmatched by any other nation, Germany has confronted its horrific past with commendable honesty. After World War II, Germany assumed responsibility for its crimes and obliged itself both to protect Jewish life and to offer sanctuary to those escaping violent conflict and political persecution. But the recent intake of so many migrants from places where anti-Semitism is rife has produced an uncomfortable tension between these two commitments.

That tension was laid bare recently when a video shot on a Berlin street went viral. It depicted a young man wearing a kippa, or Jewish skullcap, being assaulted by a Syrian asylum-seeker. German Chancellor Angela Merkel condemned the incident as a “disgrace.” This week, thousands of Germans of different faith groups donned kippa in several cities and marched in solidarity with the Jewish community.  Some Muslim women wore kippot over their hijabs. It was an admirable display. But if Germany—the country leading the rest of Europe—is serious about addressing anti-Semitism, it will need to make the safety of its Jewish communities a higher priority when considering future migrant inflows.

For the plain fact is that most of the migrants who have come (and continue to come) to Europe hail from Muslim-majority countries that long ago expelled their once-vibrant Jewish populations, where anti-Semitism figures prominently in state propaganda, and where belief in anti-Semitic conspiracy theories is widespread. To take just one obvious incongruity between Germany and the migrants it is accepting: Holocaust denial, a crime punishable by prison in Germany, is pervasive across the Muslim and Arab Middle East. Of course, it would be wrong to presume that every Syrian refugee holds the anti-Semitic attitudes of the country’s former defense minister, who published a book repeating the ancient blood libel about Jews killing gentile children to bake matzos for Passover. But it is equally misguided to deny that many have been profoundly influenced by the anti-Semitic environments in which they were raised.

So concerned were they not to appear indifferent to the sufferings of foreign Muslims, however, that many Germans welcomed them without properly considering the impact this move might have on their Jewish fellow citizens. It was only after he left office last year that former president Joachim Gauck admitted he is “terrified of multiculturalism,” adding: “I find it shameful … when anti-Semitism among people from Arab states is ignored or declared intelligible with reference to Israeli policies. Or if criticism of Islam is immediately suspected of growing out of racism and hatred of Muslims.” Similarly, Merkel waited until this February to publicly refer to “no-go areas,” high-crime, largely Muslim immigrant neighborhoods across Europe wherein state authorities fear to tread, and the very existence of which have long been furiously denied by liberals as an Islamophobic invention. “There are such areas and one has to call them by their name and do something about them,” Merkel said.

A month after Merkel decided to open her country’s borders to over 1 million mostly Muslim migrants in 2015, Germany’s four main intelligence agencies contributed to a little-noticed report warning, “We are importing Islamic extremism, Arab anti-Semitism, national and ethnic conflicts of other peoples as well as a different societal and legal understanding.” The intelligence services were pessimistic as to Germany’s ability to assimilate so many newcomers, whose presence, they feared, would only exacerbate pre-existing social tensions.

A different report released last year by the Berlin office of the American Jewish Committee found “widespread anti-Semitism” among the 68 Syrian and Iraqi refugees the researchers surveyed. “What do we know about Jews? Sure, a religion, but they falsified it,” Bader, a 33-year-old from Damascus, told the researchers. “We know this. They have a book like ours and they have prophets and we recognize their prophets and everything, but they have faked the book that was revealed by God. … The Koran states also that it is not the same book.” Partly as a result of these sorts of attitudes, the former chairwoman of the Central Council of Jews in Germany Charlotte Knoblauch said that “Jewish life is only possible in public under police protection and the strictest security precautions.”

A mother hugs her son, a Syrian migrant from Deir al-Zor, as he and his family arrive at a railway station in Germany in 2015. (Zohra Bensemra / Reuters)

Merkel made a similar statement on January 27, Holocaust Memorial Day. “It is inconceivable and shameful that no Jewish institution can exist without police protection, whether it is a school, a kindergarten or a synagogue,” she lamented. Her comments were lent a particularly ominous resonance by a protest the previous month at which several thousand people of mainly Muslim and migrant background denounced the United States’s decision to relocate its embassy in Israel to Jerusalem. A mere 100 yards from Berlin’s Memorial to the Murdered Jews of Europe, demonstrators burned Israeli flags and shouted anti-Semitic slogans.

The conundrum facing Germany is no better represented than in the person of Merkel herself. The most pro-Israel chancellor in German history and the one most sensitive to Jewish concerns, Merkel’s attitude to Jewry is uncomplicated by the resentments and historical hang-ups possessed by some of her predecessors. In a 2008 speech to the Israeli Knesset, Merkel used unprecedented language to describe her country’s responsibility for Israeli security, stating that it constituted a German staatsraïson, or “reason of state.” Earlier this month, her government appointed a commissioner to fight anti-Semitism.

As to the fate of the world’s displaced, Merkel is similarly steadfast. In a 2014 New Yorker profile, George Packer asked a leader of the German Green party if Merkel—known for her ideological flexibility—had any principles. “She has a strong value of freedom, and everything else is negotiable,” this politician said. “Other Germans,” Packer noted, “added firm support for Israel to the list” of Merkel’s principles. Both of these convictions—in Germany’s responsibility to defend freedom and its responsibility to defend Jews and the Jewish state—derive, at least in part, from Merkel’s position as the first chancellor from the communist German Democratic Republic. Raised in a country that denied basic rights to its citizens and, from 1967 until the end of the Cold War, backed Arab regimes and terrorist organizations in their attacks on Israel, Merkel’s commitment to freedom and sympathy for the Jewish community constitute a wholesale repudiation of the GDR’s toxic political heritage.

A commitment to alleviating the suffering of refugees, however, does not necessitate welcoming them all to Europe. Nor does it exist in a vacuum where other values and considerations—like domestic social cohesion, the safety of Jewish communities, and the impact on European politics—should not also be acknowledged.

The chaotic nature of the influx and lack of border checks meant that most of the approximately 2 million people who entered Europe in the great wave of 2015-2016 were not refugees but economic migrants seeking jobs, according to European Union Vice Commissioner Frans Timmermans. Furthermore, even many of those who could legitimately claim refugee status were not fleeing immediate danger but rather United Nations-administered camps in safe countries like Lebanon, Jordan, and Turkey. Such places are certainly not ideal. But they do not constitute sites of persecution, war, or state-directed violence, the legal standard for determining whether an individual can claim refugee status. Comparisons to the plight of the stateless Jews of Europe—many of whom, turned away from American shores, ended up in gas chambers—which were ubiquitous at the height of the 2015 migrant crisis and used as a moral cudgel against Merkel’s critics, are inappropriate.

Another consideration Merkel evidently discounted was the effect that her decision might have on European domestic politics. Even those who believe in the justice of Europe taking in large numbers of migrants and refugees cannot deny the baleful consequences this policy has had, lifting the fortunes of anti-immigration parties that are invariably also anti-American, anti-NATO, pro-Russian, and generally illiberal. Merkel’s choice may very well have also tipped the scales in favor of Brexit.

One such faction that can directly credit its success to the migrant influx is the Alternative for Deutschland (AfD). Founded by a group of anti-euro economists in 2013, the party did not earn enough votes to clear the parliamentary threshold when it ran in that year’s Bundestag election. A mere four years later, however, having transformed into an ethnic-based party with all the illiberal baggage such a designation entails, it tripled its vote-share and became the first far-right party to enter the Bundestag in some six decades. Party members are hostile to both Muslims and Jews. The party is also a haven for nationalists who contest Germany’s historical consensus of accepting responsibility for the crimes of World War II; one of its leaders, Björn Höcke, has called Berlin’s Holocaust monument a “memorial of shame” and said Germans “need to make a 180 degree change in their politics of commemoration.”

A Syrian refugee takes a selfie with Angela Merkel in Germany (Fabrizio Bensch / Reuters)

All this was foreseen by German intelligence agencies as a consequence of the migrant influx. “We are producing extremists through immigration,” a German intelligence officer told the Welt am Sonntag newspaper in 2015. “Mainstream civil society is radicalizing because the majority don’t want migration and they are being forced by the political elite.” The other prime beneficiaries of uncontrolled mass immigration have been Europe’s nationalist governments, specifically those in Poland and Hungary. These governments have been newly emboldened to pursue authoritarian policy agendas by the popular support their tough stances on immigration have found—even among their critics.

The story of one renowned liberal Hungarian personage demonstrates this unfortunate dynamic. György Konrád is a Jewish Holocaust survivor, one of Hungary’s most celebrated living writers, and a strong critic of his country’s prime minister, the right-wing nationalist strongman Viktor Orbán. Earlier this month, Orbán’s Fidesz party was re-elected in an election that has generally been described as free not but not fair. As early as 2012, Konrád alleged in The New York Times that Orbán had transformed Hungary into a “junk democracy.” Yet Konrád’s estimation of Orbán changed as a result of the migrant crisis, on which the Hungarian leader emerged as a hardliner: He opposed the influx of migrants and built fences to keep them out.

“It hurts to admit it, but on this point Orbán was right,” Konrád told The New York Times about the prime minister’s position on immigration. Konrád did not withdraw any of his previous criticisms of Orbán (“not a good democrat and I don’t believe he is a good person”) or recant his worries about the ways in which Fidesz has gone about transforming Hungary into a virtual one-party state. But while Konrád still accused the prime minister of “emptying out democracy,” this did not necessarily mean that “the Schengen border [the European Union’s external boundary] should not be better defended against this tsunami.”

European governments may today be unanimous in their determination to prevent a repeat of the 2015-2016 crisis, but the challenges posed by mass migration are not going away. Europe’s proximity to Africa and the Middle East mean that climate change, economic stagnation, and war will continue to produce outward migratory pressures over the coming years and decades. Completely sealing off the continent’s borders is neither sensible nor humane. But nor is it sensible or humane to admit unlimited numbers of people whose cultures and value systems are so fundamentally different from those of the native population—and among whom are many who hold beliefs so firmly at odds with Europe’s post-Holocaust reckoning.

A country like Germany will have to try harder at inculcating an appreciation for its liberal democratic values among the Muslim migrants wishing to live there. Among those values is acceptance of what it means to be a citizen of the country that perpetrated the Holocaust. German politicians are beginning to recognize the challenge; a Berlin state government minister with Palestinian roots has suggested all newcomers be made to visit a concentration camp as part of their integration experience, while a lawmaker from Merkel’s Christian Democratic Union proposes that “anyone who incites anti-Semitic hate and rejects Jewish life in Germany cannot stay in our country.” At a time when some Jews are fleeing Europe once again due to anti-Semitism, that seems like an entirely reasonable condition to impose on people wanting to start a new life in a nation committed both to welcoming those fleeing persecution and to sustaining its Jewish remnant.

And while most of the headlines about Jewish life in Europe these days can be anxiety-inducing, there are signs that change is possible. After the video documenting an anti-Semitic attack in Berlin went viral, it emerged that the man wearing a kippa wasn’t a Jew, but an Arab-Israeli. Initially skeptical of the claim that it was dangerous for observant Jews to walk the streets of Berlin, he undertook the experiment of walking around in a kippa. It convinced him he’d been wrong. He said he publicized the attack to document “for the police and for the German people and even the world to see how terrible it is these days as a Jew to go through Berlin streets.”