The 18-year-old suspect initially fled the scene of the crime. The police apprehended him about an hour after the attack.
The case is being investigated by the organized crime unit of the Slovak police.
It is known that the teenager previously attended a gymnasium in the town of Kežmarok but transferred to Spišská Stará Ves during his studies. The suspect was an accomplished student, participating in Olympiads and other school competitions. The reasons for his actions remain unknown.
Prime Minister Robert Fico and other high-ranking officials also condemned the tragedy, calling on society for solidarity and support. Fico also warned the citizens of Slovakia against using the tragedy for political purposes.
More news from Radio Free Europe: