SAN FRANCISCO — A huge, out-of-control fire caused catastrophic damage to a quarter-billion-dollar apartment complex under construction at Fourth Street near China Basin in San Francisco on Tuesday evening, according to the San Francisco Fire Department.

The massive blaze broke out shortly after 5 p.m., spreading through the building quickly and sending embers floating toward nearby buildings as fire crews worked to contain the blaze. Shortly before 6 p.m., one side of the building collapsed, and a fire dispatcher with the department confirmed the structure was collapsing internally.

“Everybody is heading there,” the dispatcher said. “We don’t go past five alarms in this city.”

The fire appeared to totally destroy MB360, a $227 million apartment complex being developed by San Francisco-based BRE Properties Inc. The project was slated to open sometime later this year.

Representatives for the development company were not available for comment.

There were no reports of injuries as of 9 p.m. Fire crews pulled back from the building around 6 p.m. to stay clear of possibly spreading flames or collapsing walls, but later moved closer to work on controlling the blaze.

While initial reports suggested high winds may have played a factor in the spread of the smoke and flames, the National Weather Service said downtown San Francisco experienced wind speeds of no more than 10 mph Tuesday, and that heavy winds were not expected Tuesday night.

At 9 p.m., firefighters were still working to contain the flames, and officials would not give an estimate for when the fire would be brought under control. Still, no flames could be seen from the surrounding streets and the thick black smoke that poured from the complex earlier had eased considerably.

“Seeing white smoke is a good sign,” San Francisco fire Chief Joanne Hayes-White said around 6:30 p.m. “We’re getting the upper hand on it.”

Bay Area Red Cross officials set up a triage center to help residents who had been evacuated, as well as fire crews. San Francisco police Sgt. Eric O’Neil said that apartments along Third Street from King Street to China Basin had been evacuated.

O’Neil said blocks surrounding the fire were closed both for emergency vehicle access and hazards caused by the burning building.

David Moyes, 30, was visiting friends at the evacuated Strata Mission Bay apartment building when the alarm sounded. He said the sound of wood crackling and burning at the construction site was ‘startling.’

“It was smoke and brimstone,” he said. “Sounded like the Fourth of July. … We were playing video games and then, just this noise, sounded like fireworks. Like sporadic noises. We just ran, went to the door and saw the smoke and just ran outside.”

For South Bay residents, reports of the fire brought back memories of a six-acre fire at Santana Row in August 2002. The upscale mall was still under construction when it erupted in a monstrous blaze and tested the city’s fire department emergency response system.

The fire became the worst in San Jose’s history, and the department — forced for the first time to seek help from outside Santa Clara County — called in more than 200 firefighters and 70 trucks, engines and other vehicles from San Jose and 11 other departments.

The smoke and flames caused more than $100 million in damage to the shopping center site. Falling embers that ignited roofs half a mile away destroyed more than 30 apartments and townhouses in a nearby neighborhood, resulting in $2.5 million in damage.

Fire officials were never able to determine how the blaze started, but they noted that large construction sites are vulnerable to catastrophic fires before sprinkler systems, drywall and other fireproofing are added to protect the wooden framing.

Ethan Weiss, an associate professor in the cardiology department at UC San Francisco, said he was unaware of Tuesday’s fire until someone yelled at him from another office to look out his window.

“It is literally to the left of my computer,” Weiss said as he and some colleagues were heading to a faculty dinner across town. “It’s just ash and water now. The building is a shell. It’s gone.

“It’s amazing. When this started, it looked like firefighters had things under control. And then it just went nuts.”

Many people waiting nearby had dogs in tow, including Kelly King, who moved into the Strata Mission Bay building a week and a half ago. She said she grabbed her Boston terrier, Yoshi, and chocolate labrador, Riddick, when she heard the alarm.

“I didn’t grab my purse or computer or anything,” she said.

King said the evacuation went smoothly, although there was smoke in the stairwell and the sound of the alarm scared her dogs.

“They were pulling me all the way down the stairs,” she said.

Follow Katie Nelson at Twitter.com/katienelson210.