Three are dead and two injured after a masked man armed with a sword went on a violent rampage at a school in Sweden.

According to Swedish news outlet The Local, the attack occurred Thursday morning at an elementary school in Trollhattan.

Reports say the assailant entered the school wearing a Darth Vader-esque mask and wielding a long blade, which he used to attack several students and a teacher. The attacker was shot by Swedish police and has been confirmed dead.

Two of the victims, a teacher and a young boy of unknown age, died from the assault. Two other students were left wounded.

Police spokesperson Stefan Gustafsson later told reporters the assailant used "several knife-like objects."

The suspect was identified as a 21-year-old local resident.

Students originally thought the man was dressed as a Halloween prank.

"When we first saw him, we thought it was a joke. He was wearing a mask and black clothes and [carrying] a long sword. Some students wanted to take their picture with him and feel the sword," a student said to the TT news agency.

The exact details of the attack have not been made clear. TT reported that the incident may have begun in a cafe on the school grounds.

"I was in a classroom with my class when one of my classmates' sisters called her to warn her that there was a murderer at the school. So we locked the door to the classroom, but our teacher was still outside in the corridor," said one teen, apparently one of the victim's students. "We wanted to warn him, so a few of us went outside and then I saw the murderer, he was wearing a mask and had a sword. Our teacher got stabbed."

400 students, ages 6 to 15, attend the school in Trollhattan. The town is located about 46 miles north of Gothenburg, Sweden's second largest city.

The attacker's motives are unknown, but some suspect the act was connected to racial tensions in the area.

"This is a black day for Sweden," Prime Minister Stefan Lofven said, according to USA Today. "I think of the victims and their families, students and staff, and the whole of the affected community. No words can describe what they are going through right now."