His first targets were writing an exam, reports CBS News correspondent Sheila MacVicar.
By the time police got into the building, the school was on fire, there were reports of explosives, and many students had been wounded.
The gunman, also a student, shot himself and later died in the hospital.
Last Friday, 22-year-old Matti Saari posted videos on YouTube, practicing his aim with what the Finnish government says was his legal, and only weapon.
Monday the local police, alerted to the Internet videos, called him in for questioning. They could find no reason to detain him, or to take his gun.
The shootings began just before 11 a.m. local time, as about 150 students were at the Kauhajoki School of Hospitality, 180 miles northwest of Helsinki.
"I heard several dozen rounds of shots, in other words it was an automatic pistol," school janitor Jukka Forsberg told Finnish broadcaster YLE. "I saw some female students who were wailing and moaning and one managed to escape out the back door."
Police spokesman Jari Neulaniemi said the attacker walked into the school armed with a .22-caliber pistol and some kind of explosive devices that were used to start a fire. He killed 10 people, some of whom were burned beyond recognition, Neulaniemi said. The big bag apparently contained the explosives.
It was Finland's second school massacre in less than a year and the two attacks had eerie similarities. Both gunmen posted violent clips on YouTube prior to the massacres, 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 gunman was taken to a hospital in Tampere, about two hours away, along with a female victim he had shot in the head, hospital officials said. The gunman later died, according to hospital's medical director.
The female victim's condition was not immediately clear. Police said two people were wounded, in addition to the 10 victims and dead shooter.
Finnish broadcaster YLE said police 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.
"We have experienced a tragic day," Prime Minister Matti Vanhanen said as he expressed condolences to the families of the victims and declared Wednesday a day of mourning.
Finnish authorities did not confirm exactly what YouTube clips were linked to the shooter.
But in one YouTube clip, a young man wearing a leather jacket fires several shots in rapid succession with a handgun at what appears to be a shooting range.
The posting was made five days before the shooting and the location was given as Kauhajoki - the same town as Tuesday's shooting. The posting included a message saying: "Whole life is war and whole life is pain. And you will fight alone in your personal war."
The person who posted the clip identified himself as a 22-year-old named "Mr. Saari." He also posted three other clips of himself firing a handgun in the past three weeks.
Clips from the 1999 Columbine school shootings in Colorado were listed among his favorite videos.
Another clip shown by Scandinavian media showed the alleged gunman pointing his gun to the camera and saying "You will die next" before firing four rounds.
Last November, another gunman killed eight people and himself at a school in southern Finland, an attack that triggered a fierce debate about gun laws in this Nordic nation with deep-rooted hunting traditions in the sub-Arctic wilderness.
Pekka-Eric Auvinen, described by police as a bullied 18-year-old outcast, opened fire at his high school in southern Finland on Nov. 7, killing six students, a school nurse and the principal before ending his own life.
Finnish investigators have said Auvinen left a suicide note for his family and foreshadowed his attack in YouTube postings.
With 1.6 million firearms in private hands, Finland is an anomaly in Europe, lagging behind only the United States and Yemen in civilian gun ownership, studies show.
After Auvinen's rampage, the government said it would raise the minimum age for buying guns from 15 to 18, but insisted there was no need for sweeping changes to Finland's gun laws. The age limit was never raised.