Evacuations were still in effect as of 7:41 p.m. for the 3300 block of Mission Street and 29th Street between San Jose Avenue and Mission Street, fire spokesman Jonathan Baxter said.
PHOTOS: Massive fire burns in Bernal Heights
Two people were taken to a hospital to be treated for smoke inhalation and a 1-year-old was treated outside the fire for breathing issues. The child was not taken to a hospital, Baxter said.
Forty people have been displaced. Firefighters have not determined whether any pets died in the fire. However; firefighters located two cats that belonged to nearby residents.
The first report of the blaze came in at about 2:30 p.m. near Mission and 29th streets.
Manager Brian Mitchell of nearby Mitchell's Ice Cream at 688 San Jose Avenue said he heard fire trucks come on scene at about 2:30 p.m.
"There was black smoke billowing from the roof of the apartment building at 29th and Mission," Mitchell said. He saw fire burning the apartments above the 3300 Club bar at 3300 Mission St.
Firefighters contained the fire at 6:27 p.m.
A shelter-in-place order was lifted earlier this evening for a five-block area bounded by San Jose Avenue on the west, Cesar Chavez Street on the north, 30th Street and Eugenia Avenue on the south and Folsom and Elsie streets on the east.
But police said Mission Street between Valencia and 30th streets will be closed at least until the morning.
Officials with the American Red Cross and the Salvation Army have set up a shelter for residents at the Salvation Army Community Center at 1156 Valencia St., Red Cross spokeswoman Kathleen Maclay said.
The San Francisco Department of Emergency Management has set up security for the shelter, which is typical, spokesman Francis Zamora said.
Baxter said Mayor Ed Lee came to the scene and spoke with affected residents.
The cause and origin of the fire is under investigation. Baxter said that this fire is not related to the recent fires in the Mission District.
People have a misconception that the fires are being set intentionally, Baxter said. That's not the case, he said.
Lost count after 20, another fire in the Mission Dist area. This one is in Bernal Heights. 29th/Mission St. pic.twitter.com/qAobygZKw5— Vanessa Nevarez (@V_TheJournalist) June 18, 2016
161701875, WF, WORKING FIRE, 4TH ALARM, 3312 MISSION ST, SF, pic.twitter.com/OGpSEDeyOk— SF Firefighters 798 (@SFFFLocal798) June 18, 2016
Sf fire bw 30th and 29th mission pic.twitter.com/QbZJMjFMJa— Kervin Calero (@kervkeys) June 18, 2016
Stay with ABC7 News for the latest details on this developing story.