HELSINKI (AP) — A 16-year-old who stabbed three fellow students and a janitor on Thursday had threatened to shoot up his school earlier this year but police judged at the time that he was not a threat.

All four victims of the stabbing at the vocational school in northern Finland were seriously injured but were in stable condition in a local hospital. Their condition was not life-threatening, Police Sgt. Tommi Tikka said.

Deputy Police Chief Arto Karnaranta said they had arrested the suspect in the town of Oulu, 600 kilometers (370 miles) north of the capital, Helsinki. Karnaranta said the suspect admitted to the stabbings but did not disclose a motive.

Karnaranta said police had no warning of the attack, but acknowledged that the suspect had made threats against the school in February.

"He had, on a games page on the Internet, expressed the idea that he would carry out a school shooting at some stage ... saying that he would 'kill the whole school' if he had a gun," Karnaranta told reporters. He said police found no weapons at the time.

Karnaranta said police had questioned the boy and his family about the February threat but released him after being assured that had made it on a whim and did not mean what he said.

Three of the victims were ages 15 to 20, police said. The male janitor was 20 or 21. Police did not give exact ages.

In 2008, a 22-year-old gunman killed nine fellow students and a teacher before shooting himself at a vocational high school in western Finland, less than a year after a teenage student fatally shot eight people and himself at a high school near Helsinki.