German Chancellor Angela Merkel's celebrated open-door policy encouraged the migration of more than 1 million refugees in 2015, and hundreds of thousands more in 2016. It was lauded as a courageous triumph of humanitarianism. Even in 2016's year-end accolades, Merkel has been given hosannas for "keeping the doors ajar."

But after last week's Berlin attack, in which a man — suspected to be a Tunisian migrant — intentionally plowed an 18-wheeler into a crowded Christmas market, killing 12 and injuring dozens more, it's fair to say that Merkel's celebrated policy has actually been a disaster. After all, "keeping the doors ajar" is precisely how a naive person learns of the bad intentions of an intruder. And Merkel is learning a hard lesson, indeed. She said that welcoming this enormous wave of refugees was the only way to be true to "European values." But the current wave of terrorism and the enormous fear of crime and disorder in European cities is proving mortally dangerous not just to her own party, but to the European Union itself.

Germany began 2016 with a spate of semi-coordinated sexual assaults against women on New Year's Eve in Cologne, most committed by asylum seekers. And it closes the year in mourning. When the suspect of the Berlin Christmas market attack, Anis Amri, rammed that truck into the shoppers, he was imitating another Islamist attack in Nice, France, earlier this year. Amri, who was shot and killed in a shootout in Milan on Friday, was an asylum seeker, although his entry to Europe predates the great 2015 wave. Earlier in 2016, another asylum seeker murdered a Polish woman in Reutlingen. And another set off a suicide bomb, injuring dozens, at a festival in Ansbach. Another attacked tourists with an axe in July. Just this month, a 17-year-old Afghan migrant in Germany was arrested in connection with the rape and murder of Maria Ladenburger, the 19-year-old daughter of a top E.U. official.

This is not just a disaster for Germany. Attackers involved in the massacre at the Bataclan in Paris, and the Brussels airport bombing, used the flow of refugees in Europe to escape detection by police. The Schengen Agreement, which all but did away with internal border checks in Europe, has positively transformed the way Europeans interact with one another. After he murdered a dozen Germans, Amri was able to escape to France and then Italy before he was caught.

Germany thought it could assimilate newcomers. It believed it had done so before, having absorbed Turkish "guestworkers" during the 1960s and 1970s. But there are notable differences between Turks and the current refugee wave. Turkey had already undergone significant secularization. This new wave of migration into Germany is showing signs of developing some of the generational problems that mass Islamic migration has created in France. Syrian migrants find that the Arabic-language mosques in Germany, often funded by Saudi Arabia, preach a form of Islam far more fundamentalist and hostile to Western people and culture than anything they knew in Syria. Secondly, Turks came with skills that were immediately put into employment in the German economy. The new migrants are hardly working at all.

Until recently, Angela Merkel had incredibly high approval ratings. She was the most solid national leader on the European scene. Her response to the European economic crash in the last decade was wrapped in idealism, respect for rules, and concern for the long-term health of the European Union; it also ferociously privileged German economic interests at the expense of Irish mortgage-holders, Greece's political stability, and soaring youth unemployment in Spain, France, and Italy.

This won her a lot of respect in Germany, for protecting that nation's high wages and a currency that makes their manufacturers surprisingly competitive on a global market. But it also revealed the European Union to be a form of soft German imperialism and domination. Naturally, nationalist resentment across the continent found in Merkel a perfect foil once her grand invitation worsened the chaos of the migration crisis, especially as violence increased. Given the concerns about migration in Britain, Merkel's policy may have even been what made Brexit possible.

Perhaps worst of all, Merkel's great defense of "European values" could mean a forever changed European life. The border-free world that symbolized peace and prosperity, and that was the practical experience of widening freedom and possibility for Europeans under 45, is now a source of danger. German mayors warn women not to travel unaccompanied or seem too "frisky," lest they invite an assault. French synagogues are surrounded by military personnel. Major events in large European cities are heavily guarded with the portentous and menacing presence of machine guns and bomb-sniffing dogs. Instead of finding new ways of integrating migrants, the individual European states are coming up with new ways to surveil them. This is a Europe no one wanted.