Dennis Alexander, a teacher at Seaside High School in Monterey County and a reserve police officer, fired the semiautomatic handgun as it was pointed at the ceiling, police chief Abdul Pridgen said in a statement.
"He's shaken up, but he's going to be OK".
It's unclear why the teacher was displaying the firearm.
The teen's father alleged that Alexander had told students that he wanted to ensure the gun wasn't loaded moments before it went off.
Gonzales added: "It's the craziest thing". But a father told local media he and his wife were shocked when their 17-year-old son came home from school with blood on his shirt and shell fragments in his neck.
The Seaside Police Department said there were no "serious injuries" in the incident.
A picture obtained by KSBW showed the student with small red bruising to his neck, which Gonzales said appeared to be caused by a bullet fragment. It is illegal for a non-authorized person to carry a firearm in California classrooms, and the school district superintendent told the Monterey County Weekly that the teacher was not authorized by the school.
Crystal Gonzales tells The Associated Press the accident at Seaside High School happened Tuesday at 10:30 a.m. and that police arrived at the school to investigate three hours later. The Sand City Police Department said it also placed him on administrative leave. On Wednesday, students across the country are set to walk out of their classrooms to raise awareness about gun violence and safety.
There have been other incidents involving people getting accidentally shot during gun safety classes.
The incident comes amid a national debate on how to protect students from mass shootings like the one that took the lives of 17 students in Parkland, Fla., on February 14. One might even argue that he was "highly trained".
In conclusion, if some folks are so eager to arm teachers, it's probably best the teacher is well equipped to handle a gun so that a boring calculus class isn't turned into a firing range. As some of you may know, the teacher is a reserve police officer.