BRUNSWICK, Maine — Town officials informed 18 tenants of a Dunning Street apartment building on Wednesday that they had about 12 hours to vacate the building because it had been deemed “dangerous” due to violations of fire and life safety codes.

But the owner of the building, Curtis Pass, said the town was heavy-handed in closing the doors, and argued that he was making required improvements.

Late Wednesday morning, Deputy Chief Jeff Emerson of the Brunswick Fire Department placed yellow notices on the doors of each apartment notifying tenants that due to fire and life safety code deficiencies, they had until midnight Wednesday to leave.

According to Emerson, the town first notified Pass in October 2013 of a number of violations including missing smoke detectors, sprinklers and fire doors, no second exit from at least one unit, and a lack of a fire alarm system required by ordinance in any building with 12 or more apartments.

Emerson said Pass solved the latter problem by closing a third-floor apartment, but during a subsequent inspection Emerson found a third-floor balcony was still being used.

Since then, the town has conducted site visits and granted four extensions, according to documentation provided Thursday by Emerson. After the last extension, Pass was told that all violations had to be addressed by July 31 to avoid legal action, but an inspection on Friday indicated that six to eight of the violations remained unresolved.

Emerson said the short notice to tenants was unfortunate but necessary to ensure their safety.

“When you start talking about life safety concerns, and you decide to take immediate action, it needs to be immediate,” he said. “We don’t take this lightly. We provided a safe place for tenants to stay, we provided a place for pets, we provided emergency food. We did everything we could do to lessen the impact on tenants.”

On Wednesday, tenants were told to contact the Brunswick Department of Human Resources for assistance. Several spent Wednesday night in rooms provided by the town at the Rodeway Inn, according to Kelly Smyre, 24, who until Wednesday lived on the second floor of 9 Dunning St.

Smyre, who said he moved into the apartment on Sept. 1, said he noticed after moving in that his apartment had no smoke detector.

Still, Smyre said while he has a job offer in Lewiston and “will be fine,” most residents of the building live on fixed incomes and don’t have many options

On Thursday morning, at least one tenant appeared to have remained in the building overnight. Several others returned to move belongings out of their apartments.

But Pass told The Forecaster on Wednesday that he was “blindsided” by the order, which he said was “uncalled for” and “wrong.”

“There’s no reason for this,” he said. “If Emerson was willing to work with me on this and let me finish this in my time, not some artificial time, this could all be done.”

But Emerson said the town had given Pass nearly a year to address the problems.

He referred to an April 2011 fire at a three-story apartment building at 45 Maine St. in which tenants from more than a dozen apartments and four businesses were displaced. During the hours-long battle against the flames, one person was rescued from a third-story window and several of the some 100 firefighters on scene became disori ented in the maze of rooms and had trouble finding a way out.

After that fire, owner Orville Ranger pleaded guilty to the civil charge of violation of a public safety rule for failing to have more than one way of egress or an adequate smoke detector system — violations also found in the Dunning Street building.

“We’ve been asked, ‘Why are you doing this?’” Emerson said. “I’d rather be asked that than be asked, ‘Why didn’t you do something?’”