Flames broke out just after 1 a.m. at the building on Locksley Avenue in the Inner Sunset.
[Ads /]
Firefighters say two residents jumped out of their window to get out of the building.
Three people were taken to the hospital and are expected to be OK.
The fire department says a lithium-ion battery caused the two-alarm fire.
[Ads /]
Crews say the Red Cross is helping five to eight adults with shelter.
Stay with ABC7 News for updates on this developing story.