Swedish police on Friday said they believe a man armed with a sword who killed a teacher and child had "racist motives" for the attack at a school where most of the students were from immigrant families.Investigators in the southwestern town of Trollhattan said they based their assumption on items found at the home of the 21-year-old man, who was killed by police, including "his attire, his behaviour at the scene of the crimes", and his choice of victims."Everything gives the impression that the perpetrator acted because of racist motives when he committed his crimes at the Kronan school," police said in a statement.Identified in the Swedish media as Anton Lundin-Pettersson, a native of Trollhattan, the assailant went from classroom to classroom at the school for six to 15-year-olds, which had many immigrants.He killed one teacher and a student, and injured another teacher and student who both remained in hospital on Friday.Police shot the attacker at the school and he died of his injuries in hospital several hours later.Wearing black clothes and a Darth Vader-like mask - school children initially thought it was a prank or a Halloween costume - the assailant "chose his victims based on their ethnic background," police investigator Niklas Hallgren told Swedish television SVT.