Chancellor Angela Merkel defended her government’s refugee policy Thursday  just days after asylum-seekers carried out three attacks across Germany, renewing the national debate over the acceptance since last year of more than 1 million people fleeing civil war in Syria and unrest elsewhere.

At a news conference in Berlin, Merkel quoted a fundamental principle enshrined in her country’s constitution: “human dignity shall be inviolable.” She added: “These principles mean we will give asylum to those who are politically persecuted and we will give protection to those who flee war and expulsion according to the Geneva Refugee Convention.”

The words were her first since the recent attacks have stunned the nation. In just the past week, a 17-year-old Afghan asylum-seeker stabbed four people on a train in Wurzburg; a Syrian asylum-seeker blew himself up outside a music festival in Ansbach; a Syrian killed a woman and injured two others in Reutlingen; and an 18-year-old German-Iranian killed nine people, as well as himself, in Munich. Although that last incident is not believed to be related to Islamist terrorism, it coincided not only with the other attacks in Germany, but also the carnage on Bastille Day in Nice, France.

Merkel said the asylum-seekers who carried out attacks “insult the country which took them in,” and she announced new measures that would improve security, including better information and intelligence sharing. But it’s her comments on her migrant policy—the most generous in all of Europe—that are likely to draw the most attention. These events would have seemed improbable in Germany just six years ago.

In 2010, Merkel, amid a growing anti-immigrant sentiment, famously said multiculturalism had “failed, absolutely failed.” It had, in fact, failed for a reason. Germany had always expected its “guest workers,” who came mostly from Turkey in the 1960s and ’70s, to leave like the “guests” they were supposed to be. They did not. Many stayed, had children, and lived mostly separate lives from Germans. This gave birth to “multi-kulti,” the idea that foreign-born workers could live in Germany without fully embracing it—the very same idea that Merkel deemed a failure six years ago. Her policy was one of integration: Germany would make an effort to integrate the newcomers and, in turn, the newcomers would make an effort to integrate in Germany.  

But as recently as July 2015, when Europe hadn’t yet woken up to the crisis across the Mediterranean, Merkel’s awkward exchange with a tearful Palestinian girl perhaps summed up Germany’s unease toward migrants and asylum-seekers. The teenage girl told Merkel in fluent German she wants to go to university, but feared her family, who came from a refugee camp in Lebanon, would be deported. Merkel replied: “Politics is sometimes hard. … If we now say, ‘You can all come.’ ... We just can’t manage that.” Her reply drove the girl to tears, and Merkel walked over to pat her back. She then said: “I know it’s a difficult situation. … [but] you’ve shown … a lot of other people what type of situation you can end up in.” (The girl and her family were eventually granted German residency.)

The humanitarian crisis spawned by the Syrian civil war changed everything. Last year, amid the raging conflict, Merkel announced an open-door policy for Syrians fleeing the violence, resulting in a series of events that have had wide-ranging consequences not only for Germany, but also for Europe. More than 1 million, mostly Syrian asylum-seekers entered Europe last year, about three times the number for 2014. The overwhelming majority of them went to Germany. As European nations struggled with the most-severe refugee crisis since the end of World War II, Germany felt its impact, too. There were massive anti-migrant protests across the country spearheaded by an anti-Muslim group (there were large counter-protests, as well); unease in some German communities about the newcomers; and questions about their ability to integrate.

At the time, Merkel had simply told Germans: “We can do it.” At her news conference in Berlin on Thursday, she reiterated those remarks, and added: “I didn’t say 11 months ago that it would be a simple matter that we could easily solve.”

She continued: “But I am as convinced today as I was back then that we will manage our historic duty [of accepting refugees] … And that’s why we will also overcome the new challenge confronting us, which is called Islamist terror. We will introduce the correct measures and make clear that we want to give our citizens security and that we will master the task of integration.”

But that task may not be easy, amid Merkel’s own acknowledgement that terrorists may have infiltrated the migrant route to Europe, growing unease in Germany over the asylum-seekers, and the ability of individuals to carry out attacks, seemingly at will, across Germany and the rest of Europe.