Police said the student was shot in a third-floor classroom at around 9:30 a.m. PST. He was taken to San Francisco General Hospital, where he was in fair to good condition.
The shooting happened after a student brought a gun to school. Police say the gun fired when he was showing it off. The sophomore boy who had the gun told police what happened, and was detained.
Students at Balboa High and James Denman Middle School next door were kept inside their classrooms. Only a few were released to parents who were worried for their safety and waiting outside.
Classes resumed at 11:00 am.
"The kids were hysterical, so they didn't know what happened," said Isabel Crowell, a police spokeswoman.
The wounded youth's name is not being released.
©MMI, The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed