A Santa Rosa hash oil manufacturer accused of endangering a nearby school when his plant caught fire last summer with thousands of volatile butane canisters inside has pleaded guilty to charges carrying up to 10 years in prison, a prosecutor said Thursday.

Thomas Jan Warren, 63, of Forestville, operated the Condo Court facility that burst into flames July 19 during production of the concentrated cannabis product. Workers tried unsuccessfully to put it out then fled the building, locking up a stockpile of nearly 10,000 unused butane canisters.

Firefighters initially unaware of the threat were able to squelch the blaze before any of the metal canisters, described by one fire official as “ticking time bombs,” exploded. A school serving special education students was about 100 feet away.

“We were very fortunate that we were able to stop the fire before explosions injured or killed people, from the school next door or our firefighters,” said Paul Lowenthal, Santa Rosa’s assistant fire marshal.

Warren and a dozen employees were later arrested. On Tuesday, the plant owner pleaded guilty to using a volatile substance to make the concentrated marijuana product with a sentencing enhancement for operating within 300 feet of a school.

He faces a punishment ranging from probation to 10 years in prison at his July 25 sentencing before Judge Dana Simonds. Employees could each receive up to six months in jail as their cases are resolved later this month, prosecutor Matt Hubley said.

Officials said the fire illustrates the potential danger of making hash oil, also known as honey oil, which is sold at dispensaries around the state. Under one production method, butane is used to extract oil from marijuana leaves.

Warren, who also ran A-1 Top Quality Paints in the front portion of the 8,000-square-foot warehouse, concealed his hash oil business behind a false wall, prosecutors said.

Inside, he had thousands of full and spent butane canisters as well as 1,500 pounds of marijuana and 54 pounds of processed oil.

Workers were actively using butane when the fire broke out. They left without notifying authorities, Hubley said, when they were unable to put it out with hand-held fire extinguishers.

It wasn’t until hours later that someone noticed smoke and called firefighters. They arrived to find a burning box of 96 butane canisters. The canisters can explode when heated.

Flames and smoke caused hundreds of thousands of dollars in damage to the commercial space.

“This fire is the result of unregulated, sloppy hash oil production that puts lives in danger,” Hubley said.

You can reach Staff Writer Paul Payne at 707-568-5312 or paul.payne@pressdemocrat.com. On Twitter @ppayne.