A jury in Oakland, California, acquitted one man but could not reach a verdict for the second man on charges related to the deaths of 36 people in a fast-moving 2016 fire that destroyed an Oakland, California, warehouse-turned-residence known as the "Ghost Ship." The two men were charged with 36 counts of involuntary manslaughter.

Derek Almena, 49, was the master tenant of the warehouse, which had been converted into a space for artists to live and work — and to hold parties. Max Harris, 29, acted like a building manager by collecting rent and settling household disputes, according to prosecutors. The jury found Harris not guilty and was hung on Almena. If they had been convicted, they would have faced 39 years in prison.

As the verdicts were read there were noticeable gasps by the relatives and friends who had gathered in the Alameda Court Superior Courtroom, CBS San Francisco reported.

Get Breaking News Delivered to Your Inbox

"Jurors are hopelessly deadlocked. I must declare a mistrial," Alameda County Superior Court Judge Trina Thompson said. She ordered prosecutors to return to court October 4 to say whether they would retrial Almena or reach some kind of plea deal.

It was during a large party on December 3, 2016, that flames trapped dozens on an upper floor of the largely wooden building. Prosecutors alleged that the two created a dangerous fire trap, ignoring the safety of those who used the building.

A crane is used to lift wreckage as part of search efforts in a fire-ravaged warehouse on December 5, 2016, in Oakland. Getty

Defense attorneys argued that the fire spread so quickly because it was started by arsonists and that city officials had inspected the building and never identified safety code violations.

Investigators did not rule the fire arson and never determined the cause, but Acting Assistant Fire Marshall Maria Sabatini testified, "It most likely started with a fault or failure in the electrical system," CBS San Francisco reported.

Jurors began deliberating July 31, but on August 19 — which was their 10th day of deliberations — Alameda County Superior Court Judge Trina Thompson dismissed three jurors for alleged misconduct, CBS San Francisco reported. They were replaced with three alternates and ordered the panel to start deliberating from scratch.

The blaze killed 36 partygoers, many of them young people, who were trapped on the second floor. The Ghost Ship had been packed with furniture, extension cords and other flammable material. The warehouse only had two exits and no smoke detectors, fire alarms or sprinklers, according to prosecutors.

In closing arguments, Alameda County Deputy District Attorney Autrey James said Almena and Harris didn't obtain permits because they didn't want inspections and they violated the fire code by refusing to install safety devices.

James told jurors that to find the men guilty of involuntary manslaughter, they must agree that their actions were criminally negligent. "Is failure to get a permit criminally negligent? Absolutely," he said.

CBS San Francisco

John Blackstone contributed to this report.