Trollhättan Sweden sword attacker
Anton Lundin-Petterson posed for this picture before going on the rampage AFP/Getty

A teaching assistant who died after throwing himself in front of a group of schoolchildren to protect them from a samurai sword-wielding neo-Nazi "Darth Vader" has been hailed a hero. Lavin Eskandar, 20, was killed as he tried to shield pupils from Anton Lundin Pettersson while he attacked those with dark skin at the Kronan School in Trollhattan, a small industrial town around 260 miles west of the country's capital, Sweden.

"He was a hero," Eskandar's older brother Leith, 22, told Swedish newspaper Aftonbladet, adding that Lavin had been a selfless person in death as he had been in life. "He was trying to protect the children," he said, adding that his family's grief was "indescribable".

Wearing a Darth Vader mask, Pettersson posed for photographs with students before the stabbings, with many assuming his costume was part of an early Halloween prank.

Security camera footage reportedly showed him marching through the corridors looking for his victims. A witness told the Expressen newspaper that he shouted Darth Vader's immortal "I am your father" line before stabbing four people.

A 15-year-old pupil, Ahmed Hassan, was killed along with Eskandar, while a second pupil and a 41-year-old male teacher were also injured.

Hassan had been living in Sweden for three years after moving there from Somalia. A witness told Aftonbladet that he had opened the classroom door to Pettersson, who then stabbed him in the abdomen.

The second student victim, also 15, was of Syrian background. His condition had improved overnight, a spokesperson for the Norra Alvsborgs Lanssjukhus told local media. They described the teacher's condition as "serious but stable".

Police stormed the school shortly after the attacks and fired two shots, one of which hit Pettersson, authorities said. He died later in a hospital.

Detectives described the 21-year-old as a loner, adding that evidence including witness statements suggested that he chose his victims on the base of ethnicity.

Investigator Thord Haraldsson said surveillance videos showed how "he selects his victims. And those with dark skin were attacked. The victims were dark skinned".

He said evidence appeared to show that the attacker acted alone and that police found a "kind of suicide note" in his apartment after the stabbings, in which he "tells us by that letter that he consider this his final act".

The sword's sheath was found inside a car parked near the school, Haraldsson added.

Pettersson's social media profile revealed he was interested in far right groups and had "liked" videos glorifying Nazi Germany.