A gun in a US student's backpack went off when he dropped the bag, wounding two students at his high school, police in California have said.
The 17-year-old could be charged with assault with a deadly weapon and other charges, said police Captain Bill Hayes.
Capt Hayes said it was "plausible" that the shooting was an accident, but that the boy was negligent to bring a loaded handgun to Gardena High School, a sprawling 1950s-era Los Angeles school with courtyards and rows of barracks-like classrooms.
John Deasy, incoming superintendent of the Los Angeles Unified School District, said there was no indication the student with the backpack had touched the gun before it discharged.
"He literally dropped his knapsack on the desk, and it went off," Mr Deasy said.
Deputy police chief Patrick Gannon said the student apologised before running to another classroom. "He said, 'I'm sorry', when the gun went off. It made it appear to the teacher that it was an accident," he said.
Detectives are trying to figure out where the boy got the 9mm semi-automatic pistol, which was recovered. He is being held at a juvenile detention centre after police interviewed him and his mother, Capt Hayes said.
Two 15-year-olds were struck with the same bullet, Mr Gannon said.
A girl suffered a skull fracture and bruising to the brain and developed a significant blood clot when the bullet grazed her skull, said James Ausman, a neurosurgeon at Los Angeles County Harbour-UCLA Medical Centre.
The blood clot was removed but the girl remained in critical condition. A boy was in fair condition after being hit in the neck.