Gov. Mark Dayton on Thursday signed the bill legalizing marijuana treatment of some medical conditions including cancer, other terminal and some chronic diseases, and to help reduce seizures in children with epilepsy.

Dayton's signature officially makes Minnesota the 22nd U.S. state with a medical marijuana program. About 5,000 people are expected to be eligible , with the first legal access to compounds of the cannabis plant expected on July 1, 2015.

"I thank everyone who worked together to craft and pass this legislation. I pray it will bring to the victims of ravaging illnesses the relief they are hoping for," Dayton said in a prepared statement.

The governor signed the bill privately, with no public ceremony as he often does with high-profile legislation. Dayton's insistence that law enforcement groups and some medical organizations sign off on the final proposal angered many of the private citizens who lobbied for the bill. That group included adult patients as well as parents of children with severe forms of epilepsy.

The state Department of Health will manage the medical marijuana program, in which enrollees will consent to have their use and outcomes closely monitored. There are nine qualifying medical conditions, which besides those mentioned above also include HIV/AIDS, glaucoma, Tourette's syndrome, ALS and Crohn's Disease. Patients' medical providers will have to confirm to the state that they are eligible to participate.

Minnesota's program will have a number of unique aspects compared to the other states. It will be the only medical marijuana program in the country that does not allow possession and smoking of actual marijuana plant material. Instead, patients will have access to oils and liquids that contain various plant extracts. Many doctors with experience in medical marijuana call that unusual, given that oil extracts are seen as much more potent that the plant.

Police and prosecutor groups lobbied heavily against allowing plants or smoking in Minnesota's program, and Dayton made it clear for months that he was not willing to support a medical marijuana bill if it was opposed by law enforcement groups.

Private manufacturers will bid with the Department of Health to produce and distribute the oils and liquids. The law authorizes to manufacturing and eight distribution sites around the state.

Most of the Legislature's Democrats and many Republicans approved the program in the closing days of the legislative session.