A state district judge on Thursday ordered owners of a Far East Dallas apartment complex to fix a host of fire code violations after many of its residents — including a baby thrown to safety from a window — escaped a brutal blaze last week.

Judge Tonya Parker gave the complex a week to comply. Her order came after a Dallas fire inspector testified he and his colleagues found several safety hazards throughout all the buildings at the Meadows at Ferguson that were unaffected by the Nov. 21 fire that engulfed Building F, destroying more than 40 people’s homes.

Parker said she was alarmed by videos of people jumping out of third-floor windows. She told attorneys she had concerns about the fire warning and detection systems at the complex.

“From just the little that I saw ... it seemed people were caught off guard,” she said.

City fire inspectors said some of the intact units throughout the complex were missing smoke detectors or had devices with no batteries. In addition, some sprinkler heads had been taped or painted over, and most buildings were missing water pressure gauges. And two units had windows that had been nailed shut, said Joshua Swanigan, a Dallas fire prevention officer.

Kartik Singapura, an attorney for apartment complex owner Eyal Dallas Holdings, told the judge that the company constantly makes repairs to the property. He said some tenants might be pulling out the smoke detectors or removing the batteries.

The cause of the Nov. 21 fire, which injured three people and destroyed 24 units, will likely remain a mystery. City attorneys said fire officials won’t be able to determine the source because the building was quickly demolished after it was deemed structurally unsafe.

More than 50 firefighters and police officers had rushed to the scene of the fire. They were aided in their rescue efforts by good Samaritans who banged on doors and dragged mattresses to cushion people jumping from their windows. One passerby held out his arms to catch a baby dropped by her mother from the third floor.

The fire came as the Meadows at Ferguson was already under court scrutiny. The city sued its owner last year, alleging the apartment complex is a “common nuisance” where crime and code violations abound, tolerated by Eyal. The company has denied the allegations.

In May, Parker ordered the apartment complex to undergo a series of inspections after city attorneys alleged in a court filing that Eyal hired an unlicensed fire sprinkler contractor who fabricated tags that said fire protection systems were “fully operational.”

City attorneys on Thursday filed a motion asking for Eyal to be held in contempt for allegedly violating the May order. Dallas officials have also asked the judge to appoint a receiver — a neutral party that can take over the apartment complex while the lawsuit is resolved.

Parker’s court hasn’t yet scheduled a date to consider those motions, but the attorney for Eyal told the judge on Thursday that the city’s requests were unfair.

Singapura said Building F, where the fire broke out, had been examined by a licensed inspector this summer, under the city’s watch. Singapura told the judge that Eyal has been cooperating with the city for months.

“Every time we’ve gotten a list from the city, repairs have been made,” Singapura said.

But Kristen Monkhouse, an assistant city attorney, told the judge that the company hasn’t done enough to fix the problems.

“Each time we go out there, there’s violations, and there shouldn’t be,” she said.

To underscore their arguments, city attorneys played body-cam footage of a Dallas police officer who responded to the Nov. 21 fire. They pointed out that no fire sprinklers or smoke detectors are seen or heard going off as the officer barges into several units while yelling at residents to get out.

Singapura, the Eyal attorney, argued that ringing could be heard coming from a bell attached to the side of the building that is activated by the fire protection system.

But that system — even if many decades old — should’ve also activated the fire sprinklers, said Andrew Gilbert, an assistant city attorney.

Parker declined a request from the city to order that the Meadows at Ferguson be put under a fire watch, which would have placed two Dallas Fire-Rescue employees at the property around the clock at Eyal’s expense.