"He shot himself, but he's not dead. He's injured," Ari Paananen, a spokesman for the city mayor, said.
About 200 people are believed to have been inside the school when the attacker entered the school at 11am [0800 GMT].
The subsequent shooting lasted for about 90 minutes, witnesses said.
The Kauhajoki vocational school where the shooting took place [AFP]
"Within a short space of time I heard several dozen rounds of shots, in other words it was an automatic pistol," Jukka Forsberg, a school caretaker, told Finnish broadcaster YLE.
"I saw some female students who were wailing and moaning, and one managed to escape out of the back door."
Mia Ylonen, a radio journalist, told Al Jazeera from Helsinki: "The man entered the school via the basement wearing a balaclava and carrying a briefcase.
"He then shot people in the head at close range, killing nine and wounding one," she said, adding that the attacker was in a critical condition in hospital after shooting himself in the head after the attacks."
"Police found suspicious videos posted online [on the YouTube video sharing website] where you can see the man from the city practising shooting," Ylonen said.
Anne Holmlund, Finland's interior minister, said Saari was questioned by police a day before the attacks about the videos, but he was released because they had no legal reason to keep him detained.
"Police did not take away his weapon," Ylonen said. "And this is what they want to investigate now - why his weapon was not taken away from him during questioning."
The attack comes ten months after eight students were killed in a gun attack at a school north of Helsinki.
"That was a shock for the country. In the past, Finland has been known to be peaceful and this is a huge shock," Ylonen said of Tuesday's attack.
Finland has the third-highest level of gun ownership in the world, behind the US and Yemen, a survey carried out last year by the Small Arms Survey of the Graduate Institute of International Studies in Geneva said.