OAKLAND, Calif. — A judge ordered jurors to restart deliberations Monday in the trial of two men charged with involuntary manslaughter in the deaths of 36 partygoers who died in a fire inside a cluttered San Francisco Bay Area warehouse.

The order to begin again came after the judge dismissed three female jurors for an undisclosed reason on the 10th day of deliberations.

Superior Judge Trina Thompson excused the jurors and replaced them with alternates at the trial of Derick Almena and Max Harris following a three-month trial that has drawn family and friends of the victims to the packed courtroom.

Thompson replaced the three women with a woman and two men, telling them they should disregard all past deliberations and reminding the full jury that they cannot talk to others about the case or seek outside information about it. She also imposed a gag order preventing attorneys from discussing the case with reporters.

The Dec. 2, 2016, fire broke out during an electronic music party at the so-called Ghost Ship warehouse in Oakland. The building was packed with pianos, furniture, tangled electrical cords and other flammable material but had only two exits and no smoke detectors, fire alarms or sprinklers, prosecutors say.

The blaze killed 36 people — most of them on the building's illegally constructed second floor. Prosecutors said the victims had received no warning and had little chance to escape down a narrow, ramshackle staircase.

Monday's restart is the latest prosecutorial setback in the case.

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.

Max Harris, left, and Derick Almena

About a dozen family members and friends of the victims came to court for Tuesday's announcement but declined to speak as they left.

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

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

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.

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 what caused the fire, so arson cannot be ruled out.

Almena and Harris face up to 39 years in prison if convicted.