A 14-year-old boy allegedly killed his father before going to a nearby primary school and opening fire injuring two pupils and a teacher.1schoolThe teenager was blocked from getting into Townville Elementary School in South Carolina but fired “directly into a classroom”, officials said. Two six-year-old boys were hurt in the attack at on Wednesday. One of is in a critical condition and had to undergo surgery.

County coroner Greg Shore said the teenage gunman had since been arrested and taken into custody. Authorities did not release a motive and said they were unsure if the students and teacher were targeted. But police credited quick-thinking teachers who put the school on lockdown when he arrived.

Joanne Avery, superintendent of Anderson School District 4, told NBC News: “The school was so tightly locked down that law enforcement couldn’t even get into the building when they first got there. If they hadn’t been trained how to react, it could have been a much worse tragedy.”

The shooter was subdued by firefighter Jamie Brock, who was one of the first people to arrive at the scene, said Scott Stoller, Anderson County’s director of emergency medical services. Brock managed to prevent the boy from firing even more shots and managed to take him down without using any weapons of his own, Stoller said.