A racially motivated attack at a school in Sweden has shaken a country already experiencing a clash of ideals over immigration. Photograph by JONATHAN NACKSTRAND / AFP / Getty

“We took shelter under the tables. Everyone was scared. We cried,” a shaken eleven-year-old girl told reporters, as she described how she and her classmates hid from a masked attacker who killed two and injured several others at a school on Thursday. Her tale of the hours in lockdown, sadly, would have been nothing out of the ordinary in America, where school attacks occur almost every week. But the girl, who wore a headscarf, spoke Swedish, and was standing next to her father outside an elementary and middle school in normally peaceful Trollhättan, an industrial town about fifty miles north of Gothenburg. She blinked and looked down a few times as her father described how he had come running when his daughter had called, crying and pleading with him to hurry. He pointed to his feet: he was still in his shower sandals.

The attack has stunned Sweden, where violent crime is rare, and the last reported school attack was in 1961. Children often walk unaccompanied to school, where main entrances are usually unlocked and unguarded, allowing anyone to enter. This might be perceived as naive or even dangerous in another country, but in Sweden it is part of a very conscious and deeply rooted practice of keeping society open and accessible to its citizens.

The twenty-one-year-old killer was a native Swede named Anton Lundin Pettersson, and according to witnesses he arrived at the school in a black trench coat, a face mask, and a black helmet and stabbed his victims with a large knife. After attacking an Iraqi-born teacher’s aide, at the school entrance, he appeared to have deliberately avoided fair-skinned students. Instead, he marched on until he found and killed a Somali-born fifteen-year-old and severely injured a recently arrived Syrian teenager, according to Swedish police. Shortly after, police gunned down the attacker, who died at a local hospital. He left behind a letter stating his reasons for the attack, police said, which makes clear that it was a racially motivated hate crime.

Unlike Anders Behring Breivik, the Norwegian extremist who killed sixty-nine people at a summer camp, in 2011, and was charged with terrorism, Lundin Pettersson did not carry a gun, which likely would have led to a larger death toll. He was, however, one in the familiar pattern of an isolated young man who spent much of his time online, leaving traces of his interest in Nazi Germany and far-right, anti-immigrant ideology.

Before it was taken down, his Facebook profile showed just a handful of friends and the logo of the German heavy-metal band Rammstein, which has been accused of racist and fascist sympathies. Only hours after Lundin Pettersson was identified as the attacker, right-wing fan groups appeared online, heralding him as someone who defended his country from racial integration. Trollhättan is the most segregated city in Sweden, according to Swedish political scientists: in the school’s neighborhood, half of the population is foreign-born.

The attack cut right into what has been described as an identity crisis for social democratic Sweden, which has long been the top recipient of asylum seekers per capita in Europe, and has prided itself on a humanitarian approach to the current refugee crisis. Even as some of the most generous European countries, such as Germany, have taken steps to tighten asylum procedures and limit what migration experts call “the pull factor,” Sweden has left its southern border largely open and has stood by a broad interpretation of the United Nations refugee convention, accepting three out of every four asylum seekers. The lack of a coherent European system for handling asylum seekers, a breakdown of the continent’s internal and external border controls, and the recent deterioration of Afghanistan have contributed to the influx of migrants to Sweden in recent months, as has Sweden’s policy, unique in Europe, of extending permanent residency to Syrians applying for asylum.

In a rather homogenous country of only nine and a half million people, fourteen per cent of the population is now foreign-born, and the number is expected to rise. The school killings occurred only hours after the government agency for migration announced that a hundred and ninety thousand asylum seekers could arrive in Sweden this year, almost triple the previous estimate and far surpassing the number of people who sought refuge in Sweden during the Balkan wars.

The ongoing arrival of about fifteen hundred asylum seekers each day has already caused a domestic political crisis. More than a dozen asylum centers have been set on fire in recent months, and the Sweden Democrats, a populist anti-immigrant party, have been rapidly gaining popularity, according to recent polls. The weak green-left coalition government has been forced to reënter negotiations over immigration with the center-right opposition, agreeing to some compromises in order to retain control. On Thursday, when the school attack occurred, Swedish Prime Minister Stefan Löfven abruptly left those talks to speak to victims and their families in Trollhättan.

The Swedish historian Lars Trägårdh perhaps best described the situation when he told Swedish Radio last week that the country is experiencing a clash of ideals. The traditional Swedish ideal and self-image have revolved around a pride in and recognition of the nation-state, where citizens work hard and pay taxes. But a more recently developed Swedish ideal, held by many, has more of a universal human-rights focus that sometimes places the instinct to help as many refugees as possible ahead of the traditional priorities of a nation-state, such as securing high employment levels, insuring housing and social welfare for existing citizens, and protecting its borders.

With its large foreign-aid contributions, its stated feminist foreign policy, as well as the open door to migrants and refugees, the Swedish government likes to boast about being a “humanitarian superpower.” That self-image—and, understandably, the discomfort around having an openly anti-immigrant party in parliament—has unfortunately caused Swedish politicians across the spectrum to, until recently, largely avoid debate around the sensitive issue of immigration, and whether there may be limits to what Sweden can handle, out of fear of being accused of aligning themselves with the far right.

Now the country will also have to process the trauma of what may ultimately be labelled an act of domestic terrorism. Certainly, there will be calls for increased openness and tolerance, to powerfully manifest against racism, xenophobia, and hatred, along the lines of Norway’s Jens Stoltenberg’s bold approach to the Breivik attacks. But there will also be those who say that the small, wealthy nation needs to take a more cautious approach to immigration, in order to preserve its citizens’ faith in the traditional social contract while maintaining a strong humanitarian ideal. What the U.N.H.C.R. calls the largest refugee crisis of all time may also be Sweden’s most painful and complicated political struggle in the next decade, and a very personal one for many Swedes.