Teresa Drenick, an assistant district attorney for the Alameda County District Attorney’s Office, said Tuesday that the men, who each pleaded no contest to 36 counts of involuntary manslaughter, were expected to be sentenced on Aug. 9. Mr. Almena, she said, is expected to be sentenced to nine years in prison and three years on so-called supervised release; Mr. Harris is expected to be sentenced to six years in prison and four years of supervised release.

Image Max Harris prepared the Ghost Ship warehouse for the party that took place on the night of the fire, court documents said. Credit... Alameda County Sheriff's Office

Had the case gone to trial, both men would have faced a maximum prison sentence of more than 35 years, Ms. Drenick said.

“They acted with reckless conduct, and that caused the death of 36 men and women,” she said. “With today’s pleas, not only do both they take responsibility, but they are now also found guilty of all 36 counts.”

As the master tenant, Mr. Almena had a managerial role among the residents of the warehouse, most of whom were artists seeking an affordable space in a city that has seen sharply rising housing costs in recent years. Mr. Harris was responsible for renting out the upstairs of the warehouse for the December 2016 party and prepared the space for the event, court documents said.

On the night of Dec. 2, the warehouse — which was filled with wooden antiques and curios — was quickly engulfed in flames and filled with a thick, choking smoke that rose to the second floor. Court documents said Mr. Almena collected “fence boards, shingles, window frames, wooden sculptures, tapestries, pianos, organs” and other “ramshackle pieces” that served as the kindling for the fire. And, in preparing for the party, Mr. Harris had “blocked off an area of the second floor that included a second stairwell, which effectively reduced the upstairs guests to a single point of escape,” the documents said.