A knife-wielding teenager on Wednesday trespassed into a junior high school in Saitama Prefecture near Tokyo and attacked a teacher who tried to stop him from entering a classroom, local police said.

The 17-year-old was subdued by teachers at the scene and was arrested on suspicion of attempted murder. "I wanted to kill anyone," he was quoted by police as saying.

Students of the Misasa Junior High School in Toda were not hurt as they exited the classroom where they were taking a test, but the case may prompt calls to review school safety measures as the suspect managed to make his way into the third floor of the school building.

Photo shows the junior high school in Toda, Saitama Prefecture, where an intruder carrying a knife allegedly attacked a teacher on March 1, 2023. (Kyodo)

The suspect, whose name is being withheld because he is a minor, is a high school student from the neighboring city of Saitama. According to investigative sources, he has also hinted at his involvement in a recent spate of dead, mutilated cats found in the city.

The police said the teenager had attempted to enter the classroom and got into a scuffle with a 60-year-old teacher who had been proctoring. He slashed the teacher's upper body several times.

The 60-year-old's injuries were not life-threatening. The students at one point were evacuated to the school's ground.

Schools in Japan have stepped up safety measures ever since a knife-wielding man entered an elementary school in Ikeda, Osaka Prefecture, and killed eight students and wounded 15 others in 2001.

While most schools have crisis management manuals in place, introducing costly measures such as installing security cameras and hiring security guards have remained challenging.

Related coverage:

Kawasaki high schooler stabbed in street, minor arrested

Crimes in Japan rise in 2022 for 1st time in 20 years

Suspect in attack on Japanese sociologist Miyadai killed himself