Gov. Mark Dayton signed the medical marijuana bill into law this morning.

“I pray it will bring to the victims of ravaging illnesses the relief they are hoping for,” Dayton said in a statement.

Minnesota is now the 22nd state to legalize some form of medical marijuana.

The law allows two medical cannabis manufacturers to set up operations in Minnesota and distribute the product in pill or liquid form to qualified patients. The law allows for eight distribution centers to be set up by July 1 of 2015.

Smoking marijuana will not be allowed, but vaporization would.

The law also calls for a state patient registry and an observational study on how medical marijuana is treating conditions like cancer, HIV/AIDS, glaucoma and seizures.

The law marks a compromise between the interests of parents of sick children who wanted medical marijuana to treat their kids, and police, prosecutors and medical professionals who initially opposed the idea.