A 16-year-old boy stabbed a male classmate in their school in Narashino, Chiba Prefecture, and commandeered a taxi at knifepoint before he was arrested several hours later, police said.

The teen, whose name is being withheld because he is a minor, owned up to a charge of attempted murder, the police said.

He reportedly used a knife to stab his 16-year-old classmate at around noon Thursday, the police said. The other boy had teased the suspect by throwing an eraser at him, they said.

The suspect fled the school on a bicycle, heading to a large supermarket about 5 km away, according to the police. There he hailed a taxi and soon after threatened the driver at knifepoint to get out. He drove off by himself and eventually ran into a ditch. He ran off on foot with a bag belonging to the taxi driver.

The police said he was spotted at around 6:40 p.m. walking on a street in Hanamigawa Ward, Chiba, and taken into custody.

He allegedly had a knife on him.