A gunman opened fire at a school in southern Finland on Wednesday, killing eight others andhimself, police said.

The shooter wasbelieved to be an 18-year-old male student who may have laid out his plans beforehand in a YouTube video. He turned the.22-calibre gunon himself, but initiallysurvived and was taken to hospital. He died hours later.

At least nine others had minor injuries, medical response leader Eero Hirvensalo told the Associated Press.

The shooting happened attheJokelaHigh Schoolin Tuusula,a town about 60 kilometres from the capital of Helsinki. More than 400 students ages 12 through 18 are enrolled at the school, according to municipal officials.

Seven of those killed— five boysand two girls— were students, while the eighth was the school's principal, who was heard ordering students to stay in their classrooms over the public address system just before noon.

"I stayed in the corridor to listen to more instructions, having locked my classroom door," teacher Kim Kiuru told the YLE radio station.

"After that, I saw the gunman running with what appeared to be a small-calibre handgun in his hand through the doors toward me after which I escaped to the corridor downstairs and ran in the opposite direction."

Kiuru said he saw a woman's body as he fled the building.

"Then my pupils shouted at me out of the windows to ask what they should do and I told them to jump out of the windows… and all my pupils were saved," Kiuru said.

Police Chief Matti Tohkanen said the gunman was from an "ordinary family"who belonged to a gun club and got a license for the pistol on Oct. 19. He did not have a previous criminal record, he said.

Finnish media said a YouTube video titled "Jokela High School Massacre" showed a picture of a building by a lake that appeared to be the high school, along with two photos of a young man holding a handgun. The person who posted the video was identified in the user profile as an 18-year-old man from Finland. The posting was later removed.

The profile contained a text calling for a "revolution against the system."

Municipal authorities reported having the situation "under control" at about midday local time.It was not immediately clear how the siege was resolved.

With files from the Associated Press