BANGOR, Maine — An apartment building at 62 Third St. was heavily damaged by fire early Thursday morning, according to the Bangor Fire Department.

Assistant Chief Rick Cheverie said crews were dispatched to the five-unit, three-story building just after midnight.

All five tenants in the building managed to get out safely, Cheverie said.

The blaze started in an apartment on the second floor, and crews were able to contain it to that unit.

Story continues below advertisement.

“I would say it gutted out [that] entire apartment 100 percent,” Cheverie said. “All of the tenants are going to be displaced for the foreseeable future.”

Cheverie said the fire could have been a lot worse. Firefighters managed to get it under control in about an hour.

“It was just starting to breach the wall and come into the stud bays on one of the walls,” when firefighters entered the building, Cheverie said.

Had crews not reacted as swiftly as they did, the fire could’ve easily spread to the top floor of the building, Cheverie said. Working smoke alarms in the building were also a major factor in the tenants getting out safely, he added.

Bangor Fire Department officials, the state fire marshal’s office and code enforcement are working to determine a cause.

“We have some interviews to [conduct] before we determine an actual cause,” said Cheverie.

The building’s owner, Brandon Donovan of Virginia Beach, has insurance, according to Cheverie.

Most of the tenants are staying with friends and relatives in the area, while one has reached out to the Red Cross for assistance.