Police officers stand at a cordoned area after a masked man attacked people with a sword at a school in Trollhattan, western Sweden October 22, 2015 (Photo: Reuters)
A masked man brandishing a sword broke into a school in Sweden on Thursday, killing a teacher and seriously wounding three other people, two of them children, before being shot by police.
The attack took place in the southwestern town of Trollhattan at a school for children aged between six and 15.
"One teacher has died at the scene," local health officials said.
Two boys, aged 11 and 15, were in critical condition with stab wounds, while another teacher who was seriously wounded in the attack was also being operated on, hospital staff said.
The assailant, a man in his 20s who was shot by police at the scene, was also in critical condition they said.
Police were alerted about the incident at 10:10am (0810 GMT) and have already identified the attacker. They have not disclosed any information about him and the motive for the attack remains unclear.
Media reports said the assailant was wearing a Star Wars mask, and school children initially thought it was a prank or a Halloween costume.
"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," one unidentified student told news agency TT.
When the man started attacking people, he quickly realised it wasn't a joke and fled as the assailant went from classroom to classroom looking for victims.
TT said several knives were used in the attack.
Police said there was "a lot of confusion" at the school, saying there were still pupils and teachers inside more than two hours after the attack.
According to its website, the Kronan school has around 400 pupils, including many newly-arrived immigrants.
Swedish media described it as a "problem school".
It had been criticised by the Swedish Schools Inspectorate for its lax security and on account of a number of disruptions which prevented the pupils from learning.
Teachers had complained to the inspectorate about the school library and cafe being open to the public and creating an insecure environment for the children, TT reported.
Swedish Prime Minister Stefan Lofven was expected to visit the town later on Thursday, the parliament's Twitter account said.
"This is a black day for Sweden," Lofven said in a statement.
"My thoughts go to the victims and their families, the students and staff, and the entire community. No words can describe what they're going through right now."
Crisis teams were at the school assisting parents and students.
But some parents outside were unhappy at the way the school handled the crisis.
"No one from the school called me. I found out what happened from a neighbour when I was carrying out the trash. I got into my car and came here," one father told TT after being reunited with his young daughter.
The girl, who was not identified, said the head teacher had come into her classroom and told them to stay inside and lock the door.
"We didn't know what was happening," she said.
Trollhattan is an industrial town of 57,000 and home to the former Swedish carmaker Saab which filed for bankruptcy in 2012.
School attacks are rare in normally-tranquil Sweden.
A 1961 school shooting in Kungalv, in southwestern Sweden, left one person dead and six others injured.
No other mass shootings have occurred since then, though at least one attack has been foiled, in the southern city of Malmo in 2004. Other threats have been issued but not followed through.