The fire was reported around 10:35 a.m. in a bathroom at Ida B. Wells High School at 1099 Hayes St., fire Lt. Mindy Talmadge said.
Firefighters contained the flames to the bathroom and had the fire controlled in about 15 minutes.
School district spokeswoman Gentle Blythe said students returned to the building about 20 minutes after being evacuated and normal school operations resumed.
There were no reports of injuries.
Arson investigators responded to the school but the cause of the fire has yet to be determined, Talmadge said.
Blythe said the school district and the fire department are investigating.
Wells High School is an alternative school for students 16 and older. It caters to teens who want to complete their high school education in smaller classes with a supportive "family-like" learning environment, according to the San Francisco Unified School District's Web site.