Armed police arrived at a school in Tuusula, north of Finland's capital, Helsinki, after reports of a gunman on the loose.
The school was sealed off by police. The gunman was an 18-year-old student.
Schoolchildren were escorted from the building. Police said five boys, two girls and the female head teacher were killed.
About 12 people were also hurt in the attack, which caused panic among the students.
The gunman shot himself as police stormed the building. He later died of his injuries.
The school was eventually declared safe by police.
Several school shootings have taken place in the US and Canada, but such events are extremely rare in Finland.