Seven teenagers were killed when an 18-year-old student went on a rampage at his school in southern Finland after announcing the bloodbath with a posting on the internet site YouTube.

The murderer, named by police as Pekka-Eric Auvinen, then shot himself in the head and died in hospital last night. He killed eight people, including his headteacher, after moving from classroom to classroom and spraying them with gunfire at the secondary he attended in Tuusula, a small town north of Helsinki.

"He was moving systematically through the school corridors, knocking on doors and shooting through doors," a teacher, Kim Kiuru, told a local radio station.

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

Five boys and two girls were killed in the shooting spree, as well as the headteacher. The death toll was expected to rise, since many others were badly wounded. Police put the injured at least 12.

Children climbed out of school windows and clambered over walls when the youth came prowling through the corridors shooting wildly from what police said was a .22 calibre handgun.

Hours earlier the killer, apparently in a copycat version of the Virginia Tech killings in the US in April this year, had posted a video entitled Jokela High School Massacre 11/7/2007, on YouTube in the name of Sturmgeist89 (Stormspirit89)

The video depicted a building resembling the school bursting apart to reveal the killer pointing his gun at the camera. Other material posted on the internet, and removed yesterday following the murders, showed a gunman shooting at an apple in a forest and a 1,000-word "manifesto of a natural selector" outlining the scenario for yesterday's killings and last edited late on Tuesday.

Anna-Liisa Vainio stumbled into the mayhem when she went to the school yesterday morning for a meeting with her daughter's teacher. She found pupils lying dead and injured in the corridors then saw the teenager with the gun in his hand.

The massacre was the first of its kind in Finland, where gun crime is rare, although it boasts the highest gun ownership in Europe and the highest murder rate in western Europe.

Tuomas Hulkkonen, in his final year at the high school, told the Helsingin Sanomat newspaper he had known the killer for 10 years, and that he had been acting strangely in recent days. He last spoke to him on Tuesday. "Hard to digest this when a guy you know does something like this," he said.

Other pupils, and teachers, said the gunman was a militant and a radical. One teacher told the Helsinki daily newspaper that the boy was a keen student of fascism and Stalinism. The internet "manifesto" declared "to each what they deserve" and oozed contempt for "ordinary" mortals.

"I cannot say that I am of the same race as this miserable, selfish human race. No!

"I have evolved a step higher. I am prepared to fight and die for my cause ... I, as a natural selector, will eliminate all who I see unfit, disgraces of human race and failures of natural selection."

Panicking children were taken from the school by police and ambulances to a church and another school where anxious parents tried to locate their children.

"This is a peaceful place. Nothing like this has ever happened here and will never happen again," said the mayor of Tuusula, Hannu Joensivu.

The prime minister, Matti Vanhanen, convened an emergency cabinet meeting last night. He described the killings as "an extremely sad event" and declared today a day of national mourning.

Mr Kiuru said the headteacher announced the danger over the public address system just before midday and ordered all children to remain in their classrooms. "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," Mr Kiuru told reporters.

"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."

A pupil, Terhi Vayrynen, 17, told the Associated Press that her brother Henri, 13, witnessed the killing of the headteacher through his classroom window. The girl said the gunman came into Henri's class shouting: "Revolution. Smash everything." He shot at a television and windows, but not at pupils, and ran off down the corridor.

Police said the killer's gun was legally owned but he had obtained a licence only three weeks ago. Finland has the most heavily armed civilian population in Europe, and is third worldwide, after the US and Yemen.

Although murder rates are higher in neighbouring Russia and the former Soviet Baltic states, Finland has the highest murder rate in western Europe at around 28 per 100,000 people.

According to a survey this year by Geneva's Institute of International Studies, there are 56 privately owned firearms for every 100 civilian Finns. The guns must be licensed and a licence costs €32 (£22.50).

Multimedia killers

When Cho Seung-hui killed 32 at the Virginia Tech campus this April, he stopped midway to mail off video clips, photos and a statement to a US TV network. His 'multimedia manifesto' was seen as disturbing proof of how a troubled individual could find a global audience.

Pekka-Eric Auvinen announced his plan 12 hours beforehand, but, unlike Cho, in a blog entitled Attack Information which listed the intended location, date and weapon. In English and Finnish and clearly courting notoriety, he wrote of 'mass murder, political terrorism': 'Altough [sic] I choosed [sic] the school as target, my motives for the attack are political and much much deeper and therefore I don't want this to be called only as "school shooting".'

A video posted on YouTube showed a still of Jokela school which broke apart to reveal a red-tinted man pointing a handgun at the camera; it was overdubbed with Stray Bullet by rock band KMFDM - the same lyrics were posted on the site of Eric Harris, one of the gunmen in the 1999 Columbine massacre.

Another clip showed Auvinen posing with a gun in a similar stance to that of Cho, and wearing a T-shirt reading Humanity is Overrated