OAKLAND (CBS SF) — A judge Thursday ordered Ghost Ship warehouse master tenant Derick Almena and creative director Max Harris to stand trial on 36 counts of involuntary manslaughter for their roles in a blaze at the warehouse last year that killed 36 people.

At the end of a preliminary hearing for Almena, 47, and Harris, 28, which lasted six days, Alameda County Superior Court Judge Jeffrey Horner said the fire during a music party at the warehouse at 1305 31st Ave. in Oakland’s Fruitvale district the night of Dec. 2, 2016, was “an unspeakable tragedy.”

READ MORE: Smash-And-Grab Thieves Hit San Jose Eastridge Mall Jewelry Store; 5 Sought

Horner said testimony at the tense hearing, which was guarded by five bailiffs, indicated that the warehouse, where about 25 people lived even though it didn’t have a permit for residential use and was cluttered with artwork, woodwork, RVs, trailers and other items, “was a death trap.”

Horner said the question is who was responsible for the dangerous conditions at the warehouse, which also was known as the Satya Yuga Collective, and he concluded, “There is very strong evidence it was the responsibility of these two defendants (Almena and Harris).”

The judge said, “They both had integral and substantial roles in the management of the premises.”

Horner said, “There is sufficient cause to believe that both defendants are legally responsible for what happened that night and the deaths of 36 people.”

The six defense attorneys who represent Almena and Harris made much of the fact that investigators from the Oakland Fire Department and the federal Bureau of Alcohol, Tobacco, Firearms and Explosives were never able to conclusively determine the cause of the fire, although an Oakland fire official said she believes it likely was caused by some type of an electrical problem.

Tony Serra, one of Almena’s lawyers, argued before Horner issued his ruling, “If you don’t know what the cause was you can’t establish negligence.”

Tyler Smith, one of Harris’ attorneys, said, “You can’t rule out arson, spontaneous combustion or the possibility that it was an accident like someone knocking over a candle or incense.”

Smith said it could also be argued that many of the deaths were caused by a woman who a witness testified was wearing a red beanie and a green dress and repeatedly screamed, “This is the will of the spirits of the forests” and urged people who were on the building’s second floor to stay there for their own safety, since the fire was downstairs.

Smith said that woman’s screams may be the reason many victims wound up trapped on the second floor. He said, “Maybe they heard her.”

READ MORE: Investigation Finds Vallejo Officer's Use of Deadly Force Not 'Reasonable'

Prosecutor Autrey James said he believes Almena and Harris were criminally negligent because they allowed people who lived at the warehouse to accumulate flammable chemicals and wood that was stacked to the ceiling.

James also said Almena and Harris oversaw the construction of an illegal second set of stairs at the building and the drilling of a 25-foot hole that he said opened an air draft that allowed smoke to spread quickly to the second floor during the fire and “cause the deaths of 36 people.”

In addition, James said the building didn’t have emergency lighting, sprinklers and fire alarms.

But Serra said, “The premises was not a fire trap. It was mystical, overwhelming, spiritual, ascetic, social and a community of artists and people of integrity who were not related to commerciality, greed or financial gain.”

Serra argued that the building’s owner, Chor Ng, who fled to China after the fire, “had primary responsibility” and also alleged that the Oakland Fire Department knew about the conditions at the warehouse but didn’t take any action and “is far more culpable than my client (Almena).”

After the hearing, Serra said he had expected that Horner would order Almena and Harris to stand trial but he thinks “a jury will see this case a little bit differently” and might not convict the two men.

Curtis Briggs, one of Harris’ attorneys, said, “We’re extremely encouraged because we saw the District Attorney’s evidence and their evidence against Max Harris was minimal.”

Briggs said he believes the fire was caused by “the systematic malfunction of the city of Oakland” in failing to properly oversee the warehouse’s operations and “the fault isn’t Max Harris’.”

Almena and Harris, who face up to 39 years in state prison if they’re convicted, remain in custody in lieu of $750,000 bail and they are scheduled to return to court on Jan. 2 to have their trial date set.

MORE NEWS: San Francisco Lights Up GG Park Christmas Tree After Darkest Year of Pandemic

© Copyright 2017 by CBS San Francisco and Bay City News Service. All rights reserved. This material may not be published, broadcast, rewritten or redistributed