One of the men charged in the deadly 2016 Oakland, California, Ghost Ship warehouse fire was acquitted of 36 counts of involuntary manslaughter Thursday, although the jury was unable to reach a verdict on his co-defendant.

Max Harris faced a maximum term of 39 years in state prison for his alleged roles in the devastating blaze that killed 36. The jury was "hopelessly deadlocked" on the 36 charges against Derick Almena, the man who rented out the space, prompting Judge Trina Thompson to declare a mistrial in the case.

Alameda County District Attorney Nancy O'Malley said that each of the 36 people who died in the fire "will never be forgotten" and that her office has worked tirelessly to bring their families justice.

"While I am disappointed in today’s outcome, I must respect the thoroughness and thoughtfulness of each juror in this matter, as well as the outcome of their deliberations," O'Malley said.

The district attorney said that she will meet with her trial team and families of the victims before deciding the next steps in the case against Almena. There has been no decision yet on if the DA's office will pursue a new trial.

Almena, 49, originally rented the warehouse in 2013 to build theatrical sets inside, but quickly started subletting portions of the space to other artists, while Harris was accused of helping to illegally convert the building into a living space, collect rent and organize massive parties in the labyrinth-like space.

Download the NBC News app for breaking news and politics

During the four-month trial, Alameda County prosecutors argued that Almena acted with criminal negligence by failing to install smoke alarms, sprinklers and other safety devices, and that he resisted requests to obtain proper warrants in an effort to thwart inspections.

Alemna's attorney, Brian Getz, said after court Thursday that his client was happy "in a sense" at the verdict, but was unhappy thinking about the people who died in the accident.

"For me the overwhelming aspect of this case was always the loss of life and the heartbreak these families suffered," Getz said. "I never thought that the trial should have been held against Derek because I didn’t feel in my heart that he was responsible for it any more than a lot of other people were responsible for it."

Getz then claimed the responsibility for the fire belonged to a society "where we are in one of the richest areas in the nation," but people are still living in the street and starving.

"And these people like Derek take a warehouse and get people out of the gutter and put a roof over their head and don’t have the money to furnish it according to the laws of Oakland," the lawyer said. "And that’s why this happened."

Max Harris and Derick Almena. Alameda County Sheriff's Office

Curtis Briggs, one of the lawyers who represented Harris, also blamed Oakland city leadership, who he accused of failing to step up in the aftermath of the fire to prevent such a tragedy from happening in the future.

"This isn’t a time to celebrate for Max Harris because this community is sick," Briggs said. "This community is sick because its leadership is sick and we need reform, and we need a change."

The jury began deliberating on July 31, but on Aug. 19, after 10 days of deliberations, Superior Judge Trina Thompson ordered the jury to restart deliberations.

She replaced three female jurors with alternates, a woman and two men, and instructed the whole jury to disregard all past deliberations and reminded them that they could not talk to others about the case or look for outside information about it.

Trina also imposed a gag order preventing attorneys from discussing the case with reporters.

Deputy District Attorney Autrey James said Harris was "no innocent bystander" because he essentially acted as a building manager by collecting rent and coordinating events.

During closing arguments in the four-month trial, prosecutors told jurors that 35 of the victims died on the upper level of the two-story, 86-year-old warehouse because they had no warning and little opportunity to flee down their only path to safety — a narrow, makeshift staircase. About 100 people were in the building at the time of the fire.

Survivor Aaron Marin testified that people who were struggling to escape the building were coming up the stairs, which was built of wooden shipping pallets, shaking their heads and just saying, "No."

Defense attorneys had said city workers share the blame because they didn't raise concerns about safety hazards. They also contended that the fire was set deliberately, which cannot be ruled out because no official cause of the fire was ever found.

Almena's attorney argued that prosecutors were wrong when they characterized the warehouse as a "death trap," saying his client wouldn't have lived there with his wife and three children if he thought it dangerous. The Almena family was not at 'Ghost Ship' on the night of the blaze.

This 2014 photo provided by Ajesh Shah shows the interior of a portion of the 'Ghost Ship' warehouse, taken while he was on a tour as a potential tenant of the Oakland, California, building. Ajesh Shah / AP

Harris' attorney said his client didn't design the interior of the cluttered warehouse and wasn't even there when Almena signed the lease. He said Harris was being used as a scapegoat.

Almena and Harris were set to be sentenced to nine and six years in prison, respectively, after pleading no contest to manslaughter last year. But a judge threw out their pleas after many of the victims’ families objected, saying their proposed sentences were too lenient.

Many of the families have also sued Almena and Harris, along with the owners of the building and others. The 31 cases, represented by a master complaint, say Oakland’s fire and building departments would have discovered the safety hazards in the near-10,000 square foot building, but failed to inspect it.

The owners of the building have not been charged with any crimes and have not spoken publicly about the fire.