Gov. Dannel P. Malloy signed legislation Friday legalizing marijuana for patients with debilitating diseases or medical conditions.

“For years, we’ve heard from so many patients with chronic diseases who undergo treatments like chemotherapy or radiation and are denied the palliative benefits that medical marijuana would provide,” Malloy said. “With careful regulation and safeguards, this law will allow a doctor and a patient to decide what is in that patient’s best interest.”

Opponents said during the legislative debate that by doing this Connecticut is inviting the federal government to step in and shut down any operations dispensing and growing the marijuana within the state’s borders. However, proponents said Connecticut’s law was carefully written to avoid any such conflict with the feds.

Under the law, patients with a debilitating condition must receive written certification from a physician and register with the Department of Consumer Protection. Qualifying patients and their primary caregivers can possess a combined one-month supply, the amount of which will be determined by a board consisting of eight certified physicians and enforced through DCP regulations. It will be dispensed only by pharmacies.

“We don’t want Connecticut to follow the path pursued by some other states, which essentially would legalize marijuana for anyone willing to find the right doctor and get the right prescription,” Malloy said. “Under this law, however, the Department of Consumer Protection will be able to carefully regulate and monitor the medicinal use of this drug in order to avoid the problems encountered in some other states.”