A “suicide note” and the manner in which he picked out victims by the colour of their skin to be mercilessly cut down with his sword marked out the armed man who rampaged through a Swedish school on Thursday as a racist with Nazi sympathies, police have said.

The city of Trollhättan, where the attacks took place, was still in shock as hundreds of mourners gathered at the school on Friday evening to honour the dead, grieve and express their anger.



On the same day that the government and the opposition announced plans to cope with an anticipated influx of 160,000 refugees in Sweden this year – making it harder for them to remain in the country – Swedes have been forced to question whether anti-immigrant sentiment is creating a breeding ground for violent racism.

On Friday night, police confirmed that Anton Lundin Pettersson, 21, earlier identified by Swedish media as the culprit, was the attacker. His home was cordoned off on Thursday afternoon by dozens of police, who emptied the apartment.

“The perpetrator chose dark-skinned people, not white. We are convinced it was a hate crime with a racist perspective,” said Niclas Hallgren, the chief of police in Trollhättan.

Police found a handwritten letter in his apartment, “a sort of suicide note”, which showed he had planned the attack, and in which he said he expected it would be his final act. The man, who killed a 15-year-old male pupil and a teaching assistant, was gunned down by police shortly after the alarm was raised and died two hours later in hospital. Two people, aged 15 and 41, are still fighting for their lives after the attack.

“He was dressed in a way that suggested a racist background and video showed he acted in a military fashion. His actions and the way he looked draws the mind to the Nazis,” Hallgren told journalists.

Pettersson’s Facebook and YouTube pages revealed that he liked and shared movies glorifying the Nazis. His final Facebook post was to upload some Nazi Halloween music, students at the school said.

Pettersson recently signed up to a campaign by the anti-immigrant Sweden Democrats for a referendum to halt refugees coming to Sweden, although he had no obvious political affiliation. He had no criminal record.

The young Swede entered Kronan school on Thursday morning wearing a Darth Vader-like mask and a cape and carrying a sword. “I am your father,” he said, echoing the line by the Star Wars character in The Empire Strikes Back. One of the students asked if they could be photographed with him, thinking it was a Halloween prank; he nodded but stayed silent.

Teaching assistant Lavin Eskandar, 20, then challenged him to take off his mask, yelled at children to run and tried to overpower the man, but he was stabbed and died at the scene. His family paid tribute to him as “a king and a hero in the eyes of the entire city”.

Pettersson then marched around the school, seeking targets. Ahmed Hassan, 15, died after he opened his classroom door to the attacker and was stabbed in the abdomen, according to reports. Ahmed was born in Somalia and came to Sweden three years ago.

Further clues to the killer’s motives were apparent at his home in a nondescript apartment block on Tunhemsvägen, a residential area. Directly opposite stands a school – yet Pettersson chose instead to drive a few minutes away to Kronan school in Kronogården, a suburb where most people have immigrant backgrounds, to carry out his attacks on minority ethnic people. Pettersson’s neighbours declined to speak to the Guardian.

“This offence has echoes of the Laser Man [a racist who shot immigrants in Stockholm in the 1990s] and [recent] shootings in Malmö,” said the interior minister, Anders Ygeman.

Police in the city said they had anticipated violence and adapted their crisis training in response to school attacks in the US and neighbouring Finland.

“We are certain that Sweden is part of the global system, and when we see such awful crimes in other countries, we are not any different and we have to be prepared,” Hallgren said.

It was a fortunate coincidence that a patrol had been near the school when the alarm was raised, otherwise more would have died, he said. But when they got to the scene they took action swiftly.

The revelation that the government would attempt to stem the flow of refugees to Sweden marks an official recognition that the country is finding it hard to cope. Immigration officials on Thursday doubled their estimate of the numbers coming to Sweden this year. The centre-left coalition reached an agreement with the opposition to end permanent residency permits for refugees, speed up expulsions of those refused asylum and attempt to reallocate up to 54,000 refugees from within Sweden to other EU countries.

Sweden’s official openness to refugees, backed by most of the media, has long been out of step with misgivings among the public about immigration. While there has been a sympathetic reaction to this summer’s refugee crisis, polls over more than two decades have consistently showed a plurality opposed to receiving more refugees, according to Anders Sundell, a political scientist at Gothenburg University.

“There is a large difference between what the politicians think and the general public, and the media have not questioned the politicians until recently,” Sundell said.

The official unity on this issue has encouraged opponents of increased immigration to imagine a conspiracy between politicians and the “politically correct elite”, he said. While pan-European surveys suggest Sweden is still the most tolerant nation in the EU, there has been a polarisation of opinion, with people seeking support for anti-immigrant views on shady rightwing websites.

Trollhättan has a long history of hate crime, said Ove Sernhede, a professor of social work at Gothenburg University – the first mosque to be burnt down in Sweden in the early 1990s was in the city, which is known for a hardcore of rightwing extremists. Trollhöttan is the most segregated city in Sweden, according to research by Sundell.

“During the last few weeks, we have seen arson or attempted arson attacks on asylum lodging reported every day. And now these tragic events in Trollhättan,” Sernhede said.

As people gathered outside Kronan school in the dying autumn sunshine on Friday evening, some were in tears while others shouted anti-racist slogans. The crowd was overwhelmingly of immigrant origin.

Ardyan, 17, came to the school where his friend had been killed. The immigrant from Kosovo said he was scared to go out in the evenings because racism was a problem in the city.

Hardi Zengana, 17, whose parents are Iraqi Kurds, had studied at the school and saw the killings as an attack on multiculturalism. “The area is very multicultural; we knew racism existed but not in this area. We had almost a brotherhood here. It didn’t matter where you were from,” he said. “But now it no longer feels safe any more. I don’t know how these children in the school will continue, knowing what happened.”

His friend Ivan Culjak, also 17, from Croatia, said he would never have believed something like this could happen in Sweden – it was something he knew about only from the US. “This is a tragedy for some and a warning for others in this area,” he said. “There could be revenge, but it could also lead to other attacks happening. It is a threat to everybody.”