A masked gunman has killed 10 people at a vocational school in Finland, before shooting himself.

Police say the assailant, a 20-year-old student at the school northwest of Helsinki, died several hours after shooting himself at the end of his killing spree.  

The shooting took place in the western town of Kauhajoki, about 300 kilometers from Helsinki.  The school specializes in culinary arts and tourism studies. 

Authorities say they spoke to the gunman on Monday after seeing a video he had posted on the Internet Web site YouTube showing himself dressed in dark clothing, firing at a shooting range with a handgun.  But police said there were no legal grounds to detain him.

Several fires were reported inside the school after the spree, and several accounts said the suspect may have been carrying some type of incendiary device.

Tuesday's shooting comes nearly a year after a male student, identified as Pekka-Eric Auvinen, killed eight people at a school in southern Finland before taking his own life.

Some information for this report was provided by AFP, AP and Reuters.