A sophomore had brought the gun to school in his backpack, and it discharged when he dropped the bag during health class, The Associated Press and Los Angeles Times reported, citing police and witnesses.
The student who brought the gun to school fled the classroom after the shootings but was quickly taken into custody, the AP said. CNN footage showed officers escorting a youth dressed in black from the school campus.
"He said, 'I'm sorry,' when the gun went off. It made it appear to the teacher that it was an accident," Deputy Police Chief Patrick Gannon told the AP.
The shootings happened shortly after 10:30 a.m. local time, the Times reported. A teacher called 911 at 10:41 a.m.
Initial reports indicated there were three shooting victims, but police and school officials later said two people, both students, had been shot. The teen who was shot in the head was in critical condition, Gannon said. Both wounded teens were hit by the same bullet.
The school, which has 2,400 students, was temporarily placed on lockdown following the shootings, the Times said.
Several parents who rushed to the school to make sure their kids were OK told the AP that there have been racial tensions at the school and that fights between students are a regular occurrence.
One classmate told the Times that the student who brought the gun on campus began carrying the weapon for protection after he got into a fight outside of school.