LOWELL -- A superior court judge on Thursday refused to lift a temporary restraining order that would have allowed the city and building owner to demolish the Branch Street building, where seven people perished, until all the investigations into the cause of the deadly fire are completed.

Middlesex Superior Court Judge Dennis Curran said that while remediation efforts must be made by the building owner to alleviate public safety and public health concerns voiced by city officials, "seven people are dead and we don't want any more such tragedies. We need to find out what happened."

The early-morning blaze a week ago at 77-85 Branch St. was caused by a electrical issue, according to a report by state Fire Marshal Stephen Coan. The fire had been burning for a while in the "void space" between the second and third floors of this three-story building, Coan announced at a press conference on Tuesday. Officials have ruled out arson as a cause of the state's deadliest fire in two decades, but the exact cause of this deadly inferno has yet to be determined.

The fire killed Torn Sak, his girlfriend, Ellen Vuong, and three of their five children, Sayuri Sak, 7, Anthony Sak, 12, and Ryan Sak, 9. Also killed were Tina Christakos and Robert Downs, who lived in a separate apartment. Sixty other tenants escaped, but lost everything.

Lawyers representing the Sak and Vuong familes were granted a temporary restraining order on July 10 blocking the demolition of the building after learning from reading The Sun that the building would be demolished on Tuesday. A full hearing on the order was scheduled for Thursday.

In court, City Solicitor Christine O'Connor, representing the City of Lowell, argued the city wants building owner Sanjay Patel of DK RAM LLC, to tear down the building because the building's "structural integrity is gone." While the building is cordoned off in two-block radius with three police officers guarding the site from trespassers, it would need to be shored up to alleviate public safety concerns, she said.

The attorney representing the building owner said Patel has cooperated with the investigation and paid for police details to secure the site, but he is reluctant to spend too much money on a building that is going to be torn down.

But attorneys Donald Grady Jr. and Sheryl Bourbeau, representing the Sak and Vuong families, respectively, told the judge that teams of expert fire investigators are pouring over the charred remains, looking at such things wiring, smoke detectors, fans and more to try to determine the cause of the fire.

Experts will be removing the top off one of the fans on the building to check the motor inside to determine if that is linked to the fire, Grady said.

Grady told the judge the investigation should be complete by next Wednesday, but it is important to stop the demolition of the building until then to "preserve evidence." Grady said investigators didn't get into the building until law enforcement officials were done with their probe and determined the fire was accidental. In the days since, privately-paid experts have been in the building each day and will continue over the weekend to complete the investigation by next Wednesday, so the building can be demolished next Thursday, he said.

Follow Lisa Redmond on Tout and Twitter@lredmond13_lisa.