A man was acquitted of manslaughter Thursday and a jury deadlocked for a second suspect in the trial over the fire at the Ghost Ship warehouse in Oakland, California, which killed 36 people in December 2016.

Max Harris, 29, faced 39 years in prison before his not guilty verdict was read following an emotional three-month trial.

Jurors could not reach a verdict for Derick Almena, 49, a property manager and leaseholder of the building that served as a space for artists, on the same charge. Harris acted in a manager-type role where he collected rent and settled household disputes, prosecutors said.

KEY WITNESS IN OAKLAND'S 'GHOST SHIP' FIRE TRIAL DIES BEFORE HE'S ABLE TO TESTIFY

"Jurors are hopelessly deadlocked. I must declare a mistrial," Alameda County Superior Court Judge Trina Thompson said.

Thursday's announcement was the latest surprise in a years-long rollercoaster that involved two trials and a blocked plea deal. Jurors deliberated for 14 days before coming back with their verdict.

The Dec. 2, 2016 fire broke out during an electric music party inside the warehouse. Prosecutors argued the building was packed with flammable material, furniture, pianos, rugs, had no smoke detectors and only two exits, essentially making it a "death trap."

Many of the 36 people who died during the blaze were trapped on the building's illegally constructed second floor and had little chance to escape. They all died of smoke inhalation.

"From the moment we learned of this heartbreaking tragedy, the District Attorney’s Office has worked tirelessly to bring the defendants to justice,” Almeda County District Attorney Nancy O’Malley said in a statement. "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.”

Prosecutors alleged that Almena failed to provide safety equipment for the building. During closing arguments, Alameda County Deputy District Attorney Autrey James said the men didn't obtain the required permits because they didn't want inspections.

"Is failure to get a permit criminally negligent? Absolutely," he told jurors.

Both men pleaded guilty to 36 counts of manslaughter during the first criminal trial last summer, but a judge blocked the plea deal after families of the victims called the proposed sentences too lenient. Almena was slated to be sentenced to nine years in prison and Harris to six years.

Almena's attorney, Tony Sera, repeatedly blamed other parties for the fire and said fire and police officials toured the building and never mentioned anything about it posing a danger. The defendants argued the fire was arson and blamed city workers for not raising fire hazard concerns.

While on the witness stand, Almena testified he felt sorry for what happened. He said he would have never would have let his wife and three live somewhere unsafe.

"I built something. I dreamed something, I invited, I attracted beautiful people into my space, and I'm responsible for having this idea," he said.

CLICK HERE TO GET THE FOX NEWS APP

The building was not zoned for residential use, the Los Angeles Times reported, but Almena had charged people between $300 and $1,400 each month to rent space, and sometimes live. He testified that Oakland police and fire officials knew people were living in the building.

Harris testified that he performed menial tasks to reduce his rent and said tenant built on and furnished the building as they saw fit. Prosecutors said they 's case is scheduled for Oct. 4.

The Associated Press contributed to this report.