MADISON, Wis. -

A Madison apartment complex avoided another major fire Saturday thanks to the sprinkler system that was installed when the apartments were rebuilt after a 2007 fire, officials said.

Crews were dispatched Friday to the Glacier Hills Apartment complex at 1218 McKenna Blvd. for a fire, according to a release.

When they arrived, crews found a small fire on a second-story balcony that was extinguished by a sprinkler head, officials said. The fire caused cosmetic damage to the exterior of the building, but no one was injured.

The fire was the result of improperly discarded smoking materials that started a Christmas tree on the balcony on fire, according to the release.

The installation of the sprinkler system helped the complex avoid a repeat of the July 2007 fire that caused $3.5 million in damage, officials said. The building was a total loss, all of the residents were displaced and one firefighter was injured in the first fire.