A 16-year-old boy was in critical condition after a classmate interrupted a first-period class at Taft Union High School southwest of Bakersfield, confronted him by name and fired a round from a 12-gauge shotgun into his upper body, authorities said.

The shooter, also 16, then tried to shoot a second boy and missed before an unarmed science teacher was able to talk him down, apparently taking his weapon as the other students fled from the classroom through the door.

Police officers arrived after the teacher had disarmed the shooter, and took him into custody. They seized his firearm and about 20 extra rounds in his pocket, they said.

PHOTOS: Shooting at Taft Union High School

The teacher, Ryan Heber, was struck by a pellet round to the head but not seriously injured and declined treatment, authorities said.

“If it weren’t for this teacher and his quick response, we don’t know what would have happened,” said Kern County Sheriff Donny Youngblood.

Police said a school supervisor in the hallway, also unarmed, helped Heber distract the shooter. There were no security guards or police immediately on hand to help them: The school’s armed police officer was not on duty Thursday because he had been delayed by snow, authorities said.