All of the victims were treated at nearby hospitals. At least one of the victims, a girl, is a student at the school.
CRIME MAPS: Track crime in your neighborhood
Monday was the first day of summer school and there had been no problems prior to the shooting, Gentle Blythe of the San Francisco Unified School District said.
San Francisco police have one suspect in custody and recovered two weapons.