A further pupil and a member of teaching staff are being treated at a nearby hospital. One of them is in critical condition, according to the hospital, while the other is in stable condition.
The suspected attacker has also died, police have said.
"What we know is that somebody with a Hallow'en mask [...] got into one of the classrooms in the school with a big knife or a sword, and stabbed and injured five people in the classroom, a teacher and pupils," Elisabeth Cederblad of Swedish Radio's P4 Väst channel, told Radio Sweden.
A number of other people were also injured during the attack at Kronan school in Trollhättan. The secondary school has around 400 pupils up to the ninth grade.
Cederblad added that other schools in the area were to close for the remainder of the day.
Concerns have been raised about a café located on the school site which is open to the public.
Swedish Prime Minister Stefan Löfven visited the scene of the attack late this afternoon.
In a statement published on the Swedish government's website Löfven said:
“This is a black day for Sweden. My thoughts are with the victims and their families, pupils and staff, and the entire local community. No words can describe what they are going through right now. We feel for them, and we shall ensure that they receive all the support they need.”
The Swedish king, Carl XVI Gustaf said in a statement:
"Sweden is in shock. It is with deep dismay and grief that I and my family learnt about the events in #Trollhättan. Our thoughts are with those affected and their families, and with the victims who are now in a critical condition , as well as the pupils and staff at the school who now need all our support.”