Two buildings at Gottsunda school have burned down but emergency services believe the remaining building can still be saved.
"Two parts of the school have burned down. The roof and parts of the gables have collapsed. However, we think we will be able to save the third part of the school," says Mathias Häglund, from Gretaer Stockholm's emergency services to news agency TT.
The alarm was raised at 3am after a person saw flames through a window at the school, which has 450 pupils from sixth to 9th grade. Firefighters from five stations have been working on site to stop the blaze spreading to a nearby church.
Two teenage girls were arrested at the school on suspicion of aggravated arson.