The incident happened Wednesday at a school in Stockholm's Huddinge neighborhood, the Swedish news agency TT reported.
Zakarias Labidi, a 13-year-old student who was injured in the blast, said a bottle containing a liquid and "bits of foil" was hurled into the classroom.
"It landed about two meters [6.5 feet] from our table, then a teacher came to pick it up and throw it away. Then, she noticed it was warm and then it exploded in her hand. Liquid went all over her and on some of the other students," he told TT.
Police said four people were hospitalized with minor injuries and ten others were also injured. Damage to the building was limited.
Four students were questioned by police later Wednesday. A witness said one of those questioned had built the explosive device.
"He'd seen how to do it on the Internet," the witness said.