Several families were displaced Wednesday after a fire tore through a three-story apartment building in Miami, officials said.

City of Miami firefighters responded at around 3:25 p.m. to the 2100 block of West Flagler Street, where they encountered smoke coming from the building’s crawl spaces, fire officials said.

The fire spread rapidly through the building’s crawl spaces, walls and attic, and firefighters used thermal imaging cameras and a drone to locate hotspots.

The fire was brought under control in about an hour, officials said.

The building has 18 apartments, 16 of which are occupied. Over 20 residents were accounted for, along with several pets. The American Red Cross was on scene to assist residents with temporary housing and other resources.

The cause of the fire is under investigation. The city’s building department is expected to deem the structure unsafe.