ST. PAUL – Minnesota lawmakers struck a deal Thursday to legalize medical marijuana, handing a major victory to severely ill children and adults whose emotional appeals for help propelled a major policy change that once appeared dead for the session.

Gov. Mark Dayton said he would sign the legislation, which was closer to the House's more restrictive bill than the Senate's. Some patients lamented that the agreement doesn't allow them to use actual plant material — they instead can use the drug in oil, pill and vapor form — but others were overjoyed.

"This will change my daughter's life and thousands of lives around Minnesota," said Angie Weaver of Hibbing, whose 8-year-old daughter is afflicted by a rare form of epilepsy.

The compromise bill allows for two manufacturing facilities and eight dispensaries statewide, more than the House bill called for. But it covers fewer conditions than the Senate favored. Its prohibition against using plant material disappointed some advocates, who said vaporizing the leaf or smoking the drug were the only ways some patients could get relief from their maladies.

"People in Minnesota who are suffering today who have no good options or options at all can have the hope of gaining some relief," Dibble said during a news conference.

Opponents said legalizing medical marijuana in any form would be a step toward legalizing recreational use, and risked addicting more children to pot and other drugs.

"The voices that weren't represented during this debate were the parents who have lost children to drug abuse, in which marijuana played a part," said Sen. Bill Ingebrigtsen, R-Alexandria.

Ingebrigtsen, a former sheriff, predicted drug treatment costs will soar. He said it was a fantasy if anyone thought that more children wouldn't use marijuana by legalizing its medical uses.

"It's just like alcohol and tobacco. We haven't done a very good job keeping those out of the hands of children. We're legalizing the third killer in Minnesota," he said.

One sign of the difficulty advocates had in winning over lawmakers is that Minnesota is the only state to explicitly ban smoking of medical marijuana, according to the National Conference of State Legislatures. Other states simply don't include smoking among approved methods for delivering the drug.

Eight medical conditions would qualify for treatment, including cancer, glaucoma and AIDS, with a possible ninth if the health commissioner acts on a House amendment requesting that "intractable pain" be considered as a justification.

Patients would receive an identification number if a doctor, a physician assistant or advanced-practice registered nurse certified a qualifying illness existed. Health-care providers would provide treatment data to the Minnesota Department of Health to enable researchers and policymakers to determine the medical effects of cannabis treatment.

Background checks would be required for those working at the manufacturing sites and dispensaries. Anyone participating in the medical marijuana program caught using cannabis for non-medical purposes would be ousted and subject to criminal penalties.

Jennessa Lea, 27, of North St. Paul, was among people who wanted a more liberal law. She and her 6-year-old daughter, Raegan, suffer from Ehlers-Danlos syndrome, a group of inherited disorders that affect connective tissues. Lea said smoking cannabis diminishes the pain enough that she may play with her daughter.

"That's why we need the whole plant," Lea said, choking up during an interview after the Thursday news conference. "I can't function when I'm taking only oxycodone to cope."

Twenty-one other states and the District of Columbia allow medical marijuana.

Daily poll

Did legislators make the right decision on medical marijuana? Place your vote here. See results of today's poll in Saturday's Opinion section. Daily polls are nonscientific.