Firefighters in South Portland are crediting a sprinkler system for minimizing the damage to an apartment building at 340 Clarks Pond Parkway.

The fire department was alerted to a fire at the Latitude apartment complex by a building’s fire alarm system. The building is a six-story apartment building  housing 64 units.

The automatic sprinkler system had contained a fire on a third floor balcony. 

The building was evacuated while firefighters checked the structure.

The damage was minor, and there was no smoke or water damage inside the building, according to the department.

“This is a perfect example of why fire codes and safety systems are vital,” Fire Chief Phil Selberg said.

Without the activation of the sprinklers, damage could have been substantial and people may have been harmed, according to the chief.

Portland, Scarborough and Cape Elizabeth fire departments assisted.