SAN JOSE — Firefighters battled a two-alarm structure fire at a duplex on Thursday morning, authorities said.

The blaze, which was called in just before 6 a.m., began in the attic of a structure on the 2900 block of Union Ave, according to a social media post from the San Jose Fire Department.

Around 7 a.m., firefighters had to withdraw from the structure’s interior due to a collapsed roof, authorities said. They began conducting defensive maneuvers with aerial master streams.

Firefighters knocked down the blaze at 7:51 a.m.

All residents safely evacuated from the building, authorities added. The utilities in the area were also secured.

Traffic was impacted in the area of the fire and authorities asked people to avoid the area.