LAS VEGAS (AP) — Prosecutors dropped felony drug charges Monday against a Las Vegas man who said he had a medical right to have 12 pot plants that authorities said were found in his home after a small fire in 2012.

David Silvaggio, 50, had been due for trial next month and could have faced up to four years in prison if he had been convicted of possession of marijuana and possession of a controlled substance with intent to sell.

Instead, a judge dismissed the case and Silvaggio walked out of Clark County District Court as a free man after spending 15 months fighting a case that highlighted conflicts in state medical marijuana law.

“I have every right to produce marijuana in my home,” Silvaggio told the Las Vegas Review-Journal (http://bit.ly/1f97pHw). “There was nothing in my home that was illegal.”

District Attorney Steve Wolfson said dropping the charges served the interest of justice.

Nevada medical marijuana laws spurred confusion after voters approved a constitutional amendment in 2000 allowing medicinal pot use but left patients no way to legally obtain it.

The state Legislature last year authorized taxing, regulating and distributing pot through dispensaries around the state, including 40 in Las Vegas and surrounding Clark County, 10 in Washoe County and two in Carson City.

State officials said last month they’ll miss by at least several months an April 1 legislative deadline to begin accepting applications from medical marijuana providers and growers.

Silvaggio did not deny growing and storing marijuana. He said he uses it to avoid addiction to prescribed medications and to relieve pain after two failed shoulder surgeries and for medical conditions including arthritic inflammation associated with the skin condition psoriasis.

Court documents showed Silvaggio had a physician’s approval to grow up to 49 plants and to store up to 20 ounces of usable marijuana. He said his medical marijuana card was valid until Oct. 14, 2012, a little more than a week after fire damaged one room in his home a few blocks west of downtown Las Vegas.

Investigators said they believed his sophisticated growing operation yielded too much pot for personal use. Police pointed to high-intensity lights, vortex fans, chemical nutrients and a portable air conditioning unit that investigators said sparked the fire.

Silvaggio said investigators accused him of selling $20 baggies of marijuana on the Las Vegas Strip.