Makeshift memorials erected to the victims of the Ghost Ship warehouse fire, photographed Thursday, Sept. 5, 2019 in Oakland, Calif. Jurors found defendant Max Harris not guilty of involuntary manslaughter and were unable to reach a verdict in the case against co-defendant Derick Almena. (AP Photo/D. Ross Cameron)

OAKLAND, Calif. (AP) — An emotionally taxing criminal case over the deaths of 36 people trapped in a fire inside a San Francisco Bay Area warehouse nearly three years ago will continue after a jury acquitted one defendant and deadlocked on the other.

Jurors deliberated over a two-week period before they acquitted Max Harris on Thursday of involuntary manslaughter but said they could not agree on whether to convict or acquit Derick Almena, prolonging a case already beset by delays. Sobs and gasps erupted from family and friends of the victims as the judge declared a mistrial.

The men were accused of filling a warehouse building in Oakland with so much clutter that it trapped people when the December 2016 fire broke out during an electronic music party.

Almena, 49, and Harris, 29, had pleaded no contest to manslaughter and were set to be sentenced last year to nine and six years in prison, respectively. But a judge threw out their pleas after many of the victims' families objected.

"I'm in shock," said David Gregory, whose 20-year-old daughter Michela perished in the fast-moving fire. "We were hoping for justice, but we didn't get justice today."

Michela Gregory and her 22-year-old boyfriend, Alex Vega, died when fire roared through the so-called Ghost Ship warehouse. It had been illegally converted into a live-work space for artists and held parties and other events.

The building was packed with furniture, extension cords and other flammable material but had only two exits and no smoke detectors, fire alarms or sprinklers, prosecutors say.

The blaze killed many young people trapped on the illegally constructed second floor. Prosecutors said the victims received no warning and had little chance to escape down a narrow, ramshackle staircase.

Vega's mother, Mary, was angry about Thursday's outcome but didn't regret the plea agreement getting tossed. She said she was glad that Harris served more than two years behind bars awaiting trial.

"It's something," she said. "Doesn't matter, it's not going to bring my son back."

Her son and Alex Vega's brother Alberto, 36, said Almena should be re-tried. Ten jurors wanted to find him guilty, but two disagreed.

"I know it's going to be long and exhausting, like this already was," Alberto Vega said. "The whole thing just sucks."

Prosecutors acknowledged the emotional toll of the trial on the victims' loved ones and said they would meet with families and others to evaluate their next steps in the case against Almena, including a retrial. Almena remains in custody and is due in court again Oct. 4.

Family and friends packed the courtroom for the three-month trial, leaning on each other for comfort. Jurors began deliberating July 31 but had to start again in mid-August after the judge replaced three jurors for misconduct.

"In all honesty, the worst day of my life was on Dec. 2. It can't get any worse than that. It's just a lot of suffering after that, and we continue to suffer," said Judy Hough, whose son Travis died in the fire at age 35.

"It's like the thing that never ends."

One of Almena's attorneys, Brian Getz, broke down in tears when asked for comment Thursday, saying "people shouldn't forget what happened to those 36" people. Another attorney, Tony Serra, said he was pained and anguished but vowed to win the case for Almena.

"In the next trial, we'll do better," Serra said. "It may be hung again, or he may be acquitted, but we're not going to lose."

Almena, 49, was the master tenant of the warehouse and Harris, 29, acted like a manager by collecting rent and settling household disputes, prosecutors said.

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

The defendants argued that city workers were to blame for not raising concerns about fire hazards and said the fire was arson. Investigators have never found its cause, meaning arson cannot be ruled out.

Serra, Almena's attorney, repeatedly brought up instances in which fire, police and other officials toured the two-story building and never said anything about it posing a danger.

Harris' attorney, Curtis Briggs, argued that his client had no leadership role at the warehouse and that he had not even been there when Almena signed the lease in 2013. Harris was released from jail Thursday.

Family members of the victims hug each other after learning of the not guilty verdicts in the Ghost Ship warehouse fire, Thursday, Sept. 5, 2019 in Oakland, Calif. Jurors found defendant Max Harris not guilty of involuntary manslaughter and were unable to reach a verdict in the case against co-defendant Derick Almena. (AP Photo/D. Ross Cameron)
Alberto Vega, brother of fire victim Alex Vega, speaks to the media about the verdicts in the Ghost Ship warehouse fire, Thursday, Sept. 5, 2019 in Oakland, Calif. Jurors found defendant Max Harris not guilty of involuntary manslaughter and were unable to reach a verdict in the case against co-defendant Derick Almena. (AP Photo/D. Ross Cameron)
Esperanza Gonzalez, aunt of fire victim Alex Vega, wipes away tears as she listens to comments on the verdicts in the Ghost Ship warehouse fire, Thursday, Sept. 5, 2019 in Oakland, Calif. Jurors found defendant Max Harris not guilty of involuntary manslaughter and were unable to reach a verdict in the case against co-defendant Derick Almena. (AP Photo/D. Ross Cameron)
The defense team for defendant Max Harris comments on the verdicts in the Ghost Ship warehouse fire, Thursday, Sept. 5, 2019 in Oakland, Calif. Jurors found defendant Max Harris not guilty  of involuntary manslaughter and were unable to reach a verdict in the case against co-defendant Derick Almena. (AP Photo/D. Ross Cameron)
File - In this Dec. 5, 2016, file photo, Judy Hough, left, and her husband Brian, center, hold a picture of their son Travis, who died in a warehouse fire, during a vigil at Lake Merritt in Oakland, Calif. A jury has decided the fate of two men charged with involuntary manslaughter after prosecutors say they turned a San Francisco Bay Area warehouse into a cluttered maze that trapped 36 partygoers during a fast-moving fire. The verdicts for Derick Almena and Max Harris will be announced Thursday, Sept. 5, 2019, after a three-month trial that drew family and friends of the victims to a packed courtroom, said Almena's attorney, Brian Getz. They face up to 39 years in prison if convicted. (AP Photo/Marcio Jose Sanchez, File)
This Thursday, Sept. 5, 2019 photo shows makeshift memorials erected to the victims of the Ghost Ship warehouse fire in Oakland, Calif. Jurors found defendant Max Harris not guilty of involuntary manslaughter and were unable to reach a verdict in the case against co-defendant Derick Almena. (AP Photo/D. Ross Cameron)