Teachers alerted the police to the danger after picking up warning signs.

“The school correctly interpreted the signs and identified that this young man, who is a brilliant student, had personal problems,” 20 Minuti/tio.ch quoted Ticino education department director Manuele Bertoli as saying.

Police said the arrest was instigated by a unit set up last year to prevent large-scale attacks.