The fire was reported in a three-story residential building at 628 Shotwell St. at 11:07 p.m., according to fire officials.
Firefighters arriving on the scene found flames on the top floor, fire department spokeswoman Mindy Talmadge said.
Firefighters were able to bring the fire under control by 12:23 a.m., but not before it had spread to the attic of a neighboring building at 632 Shotwell St., Talmadge said.
Eight people, many of them elderly, were displaced from the building where the fire started. Damage to that building is estimated at more than $1 million, Talmadge said.
Damage to the second building is estimated at about $150,000. Talmadge said she was not aware of any residents displaced from that building.
One civilian was treated for smoke inhalation and was taken to a hospital, Talmadge said.
The fire's cause remains under investigation.
Red Cross working with those displaced pic.twitter.com/Jq5kMF7S8T— Janet O (@JanetONews) August 25, 2015
Overnight fire at shotwell at in the Mission District in SF pic.twitter.com/wmT5p8eLxQ— Janet O (@JanetONews) August 25, 2015