sweden school
Police work at the school in Trollhattan, southwestern SwedenJonathan Nackstrand/AFP

A masked man has attacked students at a school in Sweden with a sword. He injured up to four children and one adult before being shot by police. The attack took place at the western Swedish town of Trollhattan.

"We have a number of people injured," said Stefan Gustafsson from the region's police force. He confirmed that officers had shot the man, who has been taken to the hospital in serious conditions.

sweden school
This picture made available by a student shows the masked man armed with a sword posing for a photo with two other students before the attack at the school in Trollhattan, SwedenAFP

The Local reported that around 400 pupils aged between six and 15 were in the school at the moment of the attack. Trollhattan is an industrial town 75km north of Gothenburg.

UPDATE: An hospital source told TT news agency that one of the victims, a teacher, has died. Two students, aged 11 and 15, are seriously wounded with cuts.

Swedish media say the school held a meeting Thursday morning to discuss teachers' worries that the school was too open, with a cafe for adults that meant the school could not control who comes in.

The Dagens Nyheter newspaper said students must go through the cafe to reach the school's own cafeteria and other parts of the building.

UPDATE 2pm One of the two students who were seriously wounded in the attack has died in hospital. A student told Swedish television that initially the pupils thought it was a joke.

"He had a mask and black clothes and a long sword," the pupil said.

Another student said at first he thought the attacker had something to do with Halloween. ""One of my friends walked over to him to challenge him, but when we saw he stabbed him (the teacher), we ran away," Alazze told Sweden's TV4.

UPDATE 3.30pm Police said the suspected attacker, a 21-year-old from the town who died of his wounds in hospital, had no known link with the school.

Swedish prime minister Stefan Lofven, who visited Trollhattan to offer his sympathy to those affected in the attack, called the incident a "dark day for Sweden".

"My thoughts go out to the victims and their families, pupils and staff, and the entire community that has been affected," he said. "There are no words to describe what they are going through right now. We share in their grief and we will ensure that they are given all the support they need."