OAKLAND -- A two-alarm fire that heavily damaged a Fruitvale district fourplex apartment building early Wednesday displaced 17 people, including five children, authorities said.

The residents of a downstairs unit where the fire started about 2:40 a.m. were alerted by the barking of their pit bull-mix dog, which they had found on the streets a few months ago.

They were able to get out safely, and other residents of the complex were already outside when crews arrived, authorities said. No one was injured.

The blaze broke out in the 1400 block of 39th Avenue at a complex with four units -- two upstairs and two downstairs -- Battalion Chief Coy Justice said. All the residents had escaped by the time firefighters were on the scene.

"That's very rare for a fire at that time," Justice said. "But this time, it happened."

Crews saw heavy flames and smoke coming from the building when they arrived, but they were able to knock down the fire and bring it under control in about 30 minutes, Justice said.

The blaze spread quickly after starting on a wood balcony outside the lower unit. It spread to a balcony above and then inside another apartment. The cause of the fire has not been determined yet but it is believed to be accidental, authorities said.

Two apartments were gutted, and the others were also damaged.

Damage was estimated at more than $200,000.

The American Red Cross was on hand to assist the displaced families.

Staff writer Harry Harris contributed to this report. Contact Rick Hurd at 925-945-4789 and follow him at Twitter.com/3rderh.