At least seven people died when a gunman opened fire at a school in southern Finland on Wednesday, hours after a video was posted on YouTube predicting a school massacre.

A teacher at Jokela High School told Reuters the gunman was one of its pupils.

At this moment its seven (deaths) or more, higher, Dr Eero Hirvensalo, the head of the medical response team, told Reuters.

The YouTube video, set to hard-driving music, shows a still photo of a school that appears to be Jokela High School. The photo then fragments to reveal a red-tinted picture of a man pointing a gun at the camera.

Three people were wounded in the shooting, according to early reports. One of those shot was the school principal, said Tuula Panula, spokeswoman for the Tuusula municipality, some 60 km (40 miles) from the Finnish capital Helsinki.

He (the gunman) was moving systematically through the school hallways, knocking on the doors and shooting through the doors, Kim Kiuru, a teacher at the school, said at the scene.

It felt unreal, a pupil I have taught myself was running towards me, screaming, a pistol in his hand.

The YouTube video is entitled Jokela High School Massacre - 11/7/2007 and was posted by a user called Sturmgeist89. Sturmgeist means storm spirit in German.

Police surrounded the school and a city official announced shortly before 9:00 a.m. EST that the siege was over.

Junior Constable Olli Laine said earlier police had evacuated students from the building, which houses both a middle and a high school.

Kiuru, who was teaching a grade 8 class when the shooting started, said he helped his pupils escape the building through the classroom windows.

Despite having the third-largest per capita ratio of handgun ownership in the world, violent incidents are rare at Finnish schools.

According to Finnish media, there have been four stabbings at schools since 1999. None of these caused fatalities.

The last major attack in the country came in 2002 when a young man killed including himself and six others in a bomb blast at a shopping mall in Helsinki.

(Additional reporting by Sakari Suoninen and Terhi Kinnunen; Editing by Robert Woodward)