Stockholm (AFP) - A third victim has died six weeks after a racially motivated attack at a school in western Sweden, police said Friday.

The teacher, in his 40s, died Wednesday of wounds received in the October 22 attack by a sword-wielding assailant at the Kronan school for six- to 15-year-olds in Trollhattan, police told AFP.

Police investigator Thord Haraldsson said the assailant, Anton Lundin-Pettersson, 21, targeted "those with dark complexions", with the investigation so far "pointing to Nazism", he said at the time of the attack.

The killer went from classroom to classroom, wearing black clothes, a Darth Vader-like mask and a German World War II helmet.

A 20-year-old teaching assistant and a teenage student were killed. The teacher who died Wednesday was one of two people wounded, the other being a teenage student.

The killer was quickly shot and killed by police. All the assailant's victims were of immigrant origin.

The killer's social media accounts reveal an apparent loner fascinated by Hitler, Nazi Germany and the far-right Sweden Democrat party, which is critical of Islam and rising immigration.

Sweden, a country of 9.8 million, is expecting to receive up to 190,000 asylum seekers this year -- putting it among the EU states with the highest proportion of refugees per capita as the continent struggles with a massive influx of migrants.