DENVER — When Colorado legalized marijuana two years ago, nobody was quite ready for the problem of exploding houses.

But that is exactly what firefighters, courts and lawmakers across the state are confronting these days: amateur marijuana alchemists who are turning their kitchens and basements into “Breaking Bad”-style laboratories, using flammable chemicals to extract potent drops of a marijuana concentrate commonly called hash oil, and sometimes accidentally blowing up their homes and lighting themselves on fire in the process.

The trend is not limited to Colorado — officials from Florida to Illinois to California have reported similar problems — but the blasts are creating a special headache for lawmakers and courts here, the state at the center of legal marijuana. Even as cities try to clamp down on homemade hash oil and lawmakers consider outlawing it, some enthusiasts argue for their right to make it safely without butane, and criminal defense lawyers say the practice can no longer be considered a crime under the 2012 constitutional amendment that made marijuana legal to grow, smoke, process and sell.

“This is uncharted territory,” said State Representative Mike Foote, a Democrat from northern Colorado who is grappling with how to address hash-oil explosions. “These things come up for the first time, and no one’s dealt with them before.”

Over the past year, a hash-oil explosion in a motel in Grand Junction sent two people to a hospital. In Colorado Springs, an explosion in a third-floor apartment shook the neighborhood and sprayed glass across a parking lot. And in an accident in Denver, neighbors reported a “ball of fire” that left three people hospitalized.

The explosions occur as people pump butane fuel through a tube packed with raw marijuana plants to draw out the psychoactive ingredient tetrahydrocannabinol, or THC, producing a golden, highly potent concentrate that people sometimes call honey oil, earwax or shatter. The process can fill a room with volatile butane vapors that can be ignited by an errant spark or flame.

“They get enough vapors inside the building and it goes off, and it’ll bulge out the walls,” said Chuck Mathis, the fire marshal in Grand Junction, where the Fire Department responded to four explosions last year. “They always have a different story: ‘Nothing happened’ or ‘I was cooking food, and all of a sudden there was an explosion.’ They always try to blame it on something else.”

There were 32 such blasts across Colorado in 2014, up from 12 a year earlier, according to the Rocky Mountain High-Intensity Drug Trafficking Area, which coordinates federal and state drug enforcement efforts. No one has been killed, but the fires have wrecked homes and injured dozens of people, including 17 who received treatment for severe burns, including skin grafts and surgery, at the University of Colorado Hospital’s burn center.

The legal complexities played out one snowy morning in a Denver courtroom as a district judge puzzled over the case of Paul Mannaioni. Mr. Mannaioni, 24, was charged with committing fourth-degree arson and manufacturing marijuana after explosions ripped through a marijuana cooperative in Denver that was filled with cannabis plants and littered with boxes of butane, burners, pressure cookers, metal pipes and other equipment commonly used in butane hash-oil extractions.

When emergency responders showed up, they found Mr. Mannaioni and two other people with severe burns “all over their arms and legs,” according to a police affidavit. The police said that one of his companions, Danielle Cordova, later told them that she did not know who had been manufacturing the concentrate, but that the “hash bath” exploded when the three stepped into a tent where it had been cooking.

Image

Paul Mannaioni, who was charged with committing arson in Colorado.CreditMatthew Staver for The New York Times

To prosecutors, a crime had taken place. Legalization may have given licensed and regulated marijuana manufacturing facilities the ability to extract hash oil legally in controlled environments, but officials say dangerous, homemade operations using flammable butane — a fuel for lighters, portable stoves or heaters — are still illegal.

Mr. Mannaioni’s lawyer, Robert Corry, a prominent marijuana advocate, had a different take. When Colorado’s voters passed Amendment 64 to legalize marijuana for personal use and recreational sales, Mr. Corry told the judge, they called for a fundamental shift in how Colorado treated marijuana. It is no longer an issue for the police and courts, he said, but for the regulators and bureaucrats who enforce the civil codes surrounding marijuana growers and dispensaries.

“That constitutional provision renders my client’s accused conduct to be legal,” Mr. Corry said in court. “The court system is not to be used for marijuana regulation anymore.”

He compared making butane hash oil to processing olive oil, brewing beer or distilling whiskey at home — riskier, perhaps, and vulnerable to devastating results, but no longer a drug offense worth sending a young man to prison, according to Mr. Corry. The state law being used to prosecute Mr. Mannaioni, he said, was simply no longer valid.

“There are thousands of people in Colorado who are doing this,” Mr. Corry said in an interview. “I view this as the equivalent of frying turkey for Thanksgiving. Someone spills the oil, and there’s an explosion. It’s unfortunate, but it’s not a felony crime.”

Judge A. Bruce Jones of the Second Judicial District was not buying the argument, but he grappled with the holes in the law created by legalizing marijuana. Is making hash oil “processing” marijuana — an action that was deemed legal under Amendment 64 — or is it “manufacturing”? What is the difference? How should the law view hash oil? As marijuana concentrate, or as something else entirely? And how do you produce it, exactly?

“I have no real knowledge of how you make hash oil,” Judge Jones said during the hearing.

Mr. Mannaioni has pleaded not guilty and declined to discuss the details of the explosion. He said he had worked jobs at dispensaries and helped to build marijuana cultivations since he was 18, and that it felt surreal to be prosecuted for a marijuana charge in a state that embraced legalization, where hundreds of medical and recreational dispensaries sell marijuana buds, edible treats and their own hash-oil concentrates.

“I was blown away that they even charged us,” he said. “The court system, they are having a really hard time of letting go that pot isn’t bad.”

And so far, the legal system has not budged. The state attorney general has weighed in to say legalization does not apply to butane extraction. This month, a western Colorado judge overseeing the case against a 70-year-old man charged with making hash oil in his home rejected arguments that drug laws in Colorado were now unconstitutional.

In the mountain town of Leadville, a landlord named Bill Korn spent a month last spring cleaning up after one of his tenants blew apart the kitchen trying to make hash oil in his 1880s home. The tenant pleaded guilty to an arson charge and agreed to pay Mr. Korn $7,000 in damages, a sentence Mr. Korn said felt “a little bit light.”

“They apparently don’t enforce any laws anymore,” he said.

A version of this article appears in print on , on Page A1 of the New York edition with the headline: Odd Byproduct of Legal Weed: Homes Blow Up. Order Reprints | Today’s Paper | Subscribe