Kauhajoki, Finland A chilling YouTube video with a young man firing a pistol and warning "You will die next" caught the eye of police, who questioned him but then let him go, saying they didn't have enough evidence to take away his weapon.
On Tuesday, he walked into a vocational college, the School of Hospitality, and opened fire, killing 10 people and burning their bodies with firebombs before shooting himself fatally in the head. At least two other people were wounded.
The rampage bore eerie similarities to another school massacre in Finland last year in which an 18-year-old gunman killed eight people and himself. Both gunmen posted violent clips on YouTube prior to the shootings, both were fascinated by the 1999 Columbine school shootings in Colorado, both attacked their own schools and both died after shooting themselves in the head.
The latest shooting raised questions about whether police could have stopped the bloodshed, and although there was little initial debate about gun control, Prime Minister Matti Vanhanen said the government may consider restrictions on privately held semiautomatic weapons.
There are roughly 1.6 million firearms in private hands in Finland, a nation with deep-rooted traditions of hunting in the sub-Arctic wilderness. The country's 650,000 licensed gun owners - about 13 percent of the population of 5.2 million - include hunters, target shooters and gun collectors, and Finland ranks in the top five in civilian gun ownership per capita along with the United States, Yemen, Iraq and Switzerland.
Finnish media identified the gunman as Matti Juhani Saari, a 22-year-old student at the school, which offers courses in catering, tourism, nursing and home economics.
Police declined to identify him, saying he did not have a previous criminal record.
Witnesses said panic erupted as the masked gunman, dressed in black and carrying a large bag, entered the school just before 11 a.m. and started firing in a classroom where students were taking an exam.
"I heard several dozen rounds of shots, in other words it was an automatic pistol," school janitor Jukka Forsberg told broadcaster YLE. "I saw some female students who were wailing and moaning and one managed to escape out the back door."
About 150 students were inside the school, 180 miles northwest of Helsinki, when the shooting began. Students and teachers were evacuated - some reportedly fleeing down a nearby river in row boats - as police arrived.
Jari Neulaniemi, the officer heading the investigation, said the attacker was armed with a .22-caliber pistol and firebombs that were used to start several fires. Many of the bodies in the school were burned beyond recognition, he said.
The gunman left two handwritten messages at the dormitory saying he had planned the attack since 2002 and that he hated the human race, Neulaniemi said
A video clip posted on the Internet by the alleged gunman showed him pointing his gun to the camera and saying "You will die next" before firing four rounds.
Finnish authorities did not confirm exactly what YouTube clips were linked to the shooter. But in one clip posted by a 22-year-old "Mr. Saari," a black-clad man with thinning blond hair fired several shots in rapid succession with a handgun at a shooting range.
The posting was made five days before the shooting and the location was given as Kauhajoki. It included menacing lyrics from a German electro-industrial band Wumpscut: "Whole life is war and whole life is pain. And you will fight alone in your personal war."
"Mr. Saari" also posted at least three other clips of himself firing a handgun in the past three weeks.
On Monday, police brought in the gunman for questioning about the Internet video.
They said they released him because he hadn't broken any laws and was not deemed a threat to others.