The shooting was reported at June Jordan School for Equity around 3:15 p.m, according to police.
One of the three students shot was targeted, according to police.
One female student is in critical condition and the two male students shot have non-life threatening injuries.
The condition of the fourth student has not been determined.
Gunshots were fired shortly after school got out.
The school district says this is an isolated incident.
“There were four perpetrators who were targeting a particular individual, who suffered injuries and is being cared for,” said Karwin Sui of the San Francisco Unified School District.”Two other bystanders also suffered injuries.”
Officers are searching for four suspects and telling residents and businesses to stay inside.
The school immediately went on lockout, but was lifted around 4:03 p.m.
Police are telling people to avoid the area.
SFUSD officials are working closely with police as they investigate the shooting.