The building in Little Village where nine children died in a fire Sunday had no working smoke detectors, had been cited for housing code violations and the owner was due in court later next month.

Ald. George Cardenas (12th) acknowledged the building at 2224 S. Sacramento Ave. “had a history” of violations and that his staff had been working with the building owner “for years” to correct those violations.

The building was “livable,” but there were extensive building code violations, the alderman said. Fire officials on Sunday also said the home where the fire occurred had no working smoke detectors.

RELATED: Eight children dead in Little Village: ‘God, take them to heaven’

Eight of the children who died were related to each other; they ranged in age from 3 months to 16 years old, according to family members who spoke with the Sun-Times. A ninth child died late Monday.

The fire broke out about 4 a.m. at a small residential building located between a garage and a three-story greystone apartment building, according to Chicago Fire Media Affairs and Chicago police.

All of those killed were found on the second floor of the rear building, according to Fire Media Affairs. The first floor of the building had been vacant and was boarded up.

The building was last inspected by the city on June 8 in response to a tenant complaint, according to Buildings Department spokesman Gregg Cunningham. Violations were found, and the owner is due in court Sept. 24, according to Cunningham.

The building owner listed with the Cook County Recorder of Deeds, Merced Gutierrez, could not be reached for comment. There was no answer at his door on Monday.

“The building was cited for two electrical violations. One for grounding in the front of the building and one for an illegal electrical cord going from the front building to the coach house,” referring to the rear building, Cunningham wrote in an email to the Sun-Times.

“When owners do not comply with citations and they don’t work with the inspectors to make sure these things are being addressed, then Buildings moves to shut the place down or to at least have the place vacated by the people living there. But, it gets complicated because, then, where do the people go?” Cardenas said Monday.

“In court, all of these things matter because you have to evict people and the owner is looking for time to improve. He’s got to have a chance to correct these violations. Sometimes, buildings end up in court for years because of these same patterns. We need to tighten that up — especially when it leads to severe violations.”

Cardenas said he plans to meet with Buildings Commissioner Judy Frydland this week to “see how we can improve that.”

But, he said: “Believe me, we’re trying to walk both lines and be judicious about people who live there and keep in mind that safety is paramount.”

Cardenas noted that there was “gang activity in that building and surrounding buildings,” in part, because an adjacent building was vacant.

Pressed on whether the Department of Buildings did all it could in this case to protect residents, he said:

“The Buildings Department had been on top of this for sure. … I really can’t say they don’t move fast enough or strong enough. Sometimes, we’re hamstrung by the process, by the courts and by the leniency some of these owners get — especially when they have legal counsel.”

After the June 8 inspection, City Hall determined that the electrical violations were not serious enough to warrant vacating the building, sources said. And a fire official said Monday that investigators had determined the fire was not electrical in origin.

“Other contributing factors would have had to have been present to warrant vacating the building. Further, past enforcement actions show that the owners have pulled permits and have been cooperative in addressing previous violations,” said a source familiar with the last inspection.

Meanwhile, investigators are still trying to determine the cause of the fire, which started on a rear porch of the building where the children died, Chicago Fire Department spokesman Larry Langford said Monday.

According to Langford, though investigators have ruled out the possibility that the cause of the fire was electrical, they are still working on a final determination.

“Had there been smoke detectors, the death count would have been lower, if not non-existent,” Langford said. “This fire was in the rear and from what we could see they would have had a clear path out had they been alerted early enough.”

All occupants were unconscious when firefighters found them in the smoke-filled home, Langford said.

There’s no indication anyone attempted to escape. Firefighters had to force in the front door after a passerby called 911, Langford said.

The fire ultimately spread to the rear of the apartment building on the same lot and consumed the enclosed staircase of another building next door, and two other buildings nearby sustained damage; the heat of the flames melted the vinyl siding, the fire department said.

Firefighters on Monday knocked on doors on the Little Village block where the blaze occurred, handing out smoke detectors — devices they say could have prevented the loss of life.

“The thing we really want to drive home is: please make sure you have working smoke detectors,” Deputy District Chief Walter Schroeder said.

“Contact the fire department or your alderman and we’ll get you some smoke detectors,” Schroeder said, adding that the service is free.

“We haven’t lost this many people in … I can’t even count back to when we lost this many lives and these were young people,” said Deputy District Chief Annette Nance-Holt.

“It’s tough for us too, as first responders, to pull young people out of buildings,” Nance-Holt said.

“And they did everything they possibly could to save them, but they just couldn’t. They couldn’t. We actually had one member go down he was trying so hard,” she added, referring to a firefighter who was briefly hospitalized.

The Bureau of Alcohol, Tobacco and Firearms were also lending assistance to investigators. A source close to the investigation told the Sun-Times that investigators found smoking materials and bottle rockets on a porch where the fire originated, but it wasn’t known if they sparked the blaze.

Grid View Jesse Cabos, a friend of the family of three of the children. | Rick Majewski/For the Sun-Times

Jesse Cabos, a family friend to three of the children. | Matthew Hendrickson/Sun-Times

A memorial was placed outside the home where a fire early Sunday took the lives of 10 children. | Rick Majewski/For the Sun-Times

Chicago Firefighters outside the home Sunday morning on Sacramento Avenue where eight children died in a fire. | Rick Majewski/For the Sun-Times

Rosario Vergara’s daughter noticed smoke coming from the house. | Rick Majewski/For the Sun-Times

A memorial outside the home Sunday morning. | Rick Majewski/For the Sun-Times

The father of one of the children puts a hand on a memorial outside the home Sunday morning. | Rick Majewski/For the Sun-Times

A Chicago Police officer helps construct a memorial Sunday morning. | Matthew Hendrickson/Sun-Times

Candles and a teddy bear on the sidewalk. | Rick Majewski/For the Sun-Times

The scene outside the home Sunday morning. | Rick Majewski/For the Sun-Times

People walk away from the scene. | Rick Majewski/For the Sun-Times

An enclosed staircase of a building next to the building that cause fire on south Sacramento. | Rick Majewski/For the Sun-Times

Friends and neighbors outside the home Sunday morning. | Rick Majewski/For the Sun-Times

A memorial sits outside a house next door to where eight children between 3 months and 16 years old were killed and two more teens were injured when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday morning, Aug. 27, 2018. Ashlee Rezin/Sun-Times

A memorial sits outside a house next door to where eight children between 3 months and 16 years old were killed and two more teens were injured when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday morning, Aug. 27, 2018. Ashlee Rezin/Sun-Times

A memorial sits outside a house next door to where eight children between 3 months and 16 years old were killed and two more teens were injured when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday morning, Aug. 27, 2018. Ashlee Rezin/Sun-Times

A memorial sits outside a house next door to where eight children between 3 months and 16 years old were killed and two more teens were injured when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday morning, Aug. 27, 2018. Ashlee Rezin/Sun-Times

Mourners cry at a memorial outside a house where eight children between 3 months and 16 years old were killed when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday afternoon, Aug. 27, 2018. Ashlee Rezin/Sun-Times

A memorial sits outside a house where eight children between 3 months and 16 years old were killed and two more teens were injured when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday morning, Aug. 27, 2018. Ashlee Rezin/Sun-Times

A memorial sits outside a house next door to where eight children between 3 months and 16 years old were killed and two more teens were injured when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday morning, Aug. 27, 2018. Ashlee Rezin/Sun-Times

A memorial sits outside a house where eight children between 3 months and 16 years old were killed and two more teens were injured when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday morning, Aug. 27, 2018. Ashlee Rezin/Sun-Times

Mourners cry at a memorial outside a house where eight children between 3 months and 16 years old were killed when a fire broke out in the second-story of a coach house in the 2200 block of South Sacramento Avenue, Monday afternoon, Aug. 27, 2018. Ashlee Rezin/Sun-Times

Contributing: Matthew Hendrickson