A huge fire consumed an apartment building under construction in the San Francisco Bay Area early Wednesday, shooting flames in the air and forcing people to flee as it spread and damaged or destroyed at least five nearby townhomes.

Dozens of residents evacuated, but no injuries were reported in the blaze near the border of Emeryville and Oakland. Firefighters tamped down most of the flames later in the morning, but will remain on the scene cleaning up and checking for hot spots throughout the day.

Melvin Burns, who lives across the street from the blaze, said wind woke him up and he saw flames shooting out of the windows of the unfinished building.

"I woke up next to a firestorm," he told Bay Area news station KNTV (http://bit.ly/29tRtSO ). "I was in a small panic. It took me 10 minutes to realize that I needed to leave."

Vehicles parked outside the empty building stood charred, their tires melted, while windows in the apartment complex across the street cracked from the heat.

Firefighters declared the building a total loss. It's not yet clear what ignited the blaze, which closed down an on-ramp of Interstate 580 in Oakland.

A drone helped crews get an aerial view of the blaze.