The blaze was first reported at around 10 a.m. Sunday in a wooden building in the city's Mission District.
When firefighters arrived, flames and smoke were pouring out of several windows on the top floor of the structure. Flames eventually spread to at least one adjacent building.
American Red Cross spokesman Woody Baker-Cohn says the number of people left homeless was estimated to be around 37, including seven children. He says that number was expected to rise as residents returned to the building.
The Red Cross was working on placing people in either motels or a shelter.
The fire was contained by noon. The cause is under investigation