The 21-year-old attacker was shot and injured by police after killing a teacher and an 11-year-old student and injuring another teacher and a 15-year-old student, who are both being treated at a hospital.
Swedish police said the suspect is currently being treated for gunshot wounds.
Swedish newspaper Dagens Nyheter reported the attacker entered the school in Trollhattan, 65 kilometers (40 miles) north of Gothenburg, possibly carrying two knives. The newspaper said he wore a Star Wars mask.
“Today is a black day for Sweden,” Prime Minister Stefan Lofven said in a statement. “My thoughts are with the victims, their families, the students, the personnel and the entire society affected by this.
“No words can describe what we are going through right now.”
In August, a mother and son were killed in a knife attack at an IKEA furniture store in Vasteras, located some 110 km (68 miles) west of capital Stockholm.