California Gov. Jerry Brown on Friday signed into law the state's first comprehensive regulations on medical marijuana, two decades after legalization fueled disparate local rules, a gray market in cultivation and concerns about the ease of obtaining the drug.

The package of three laws, viewed by some as a possible framework for the eventual legalization of recreational marijuana in the most populous state, would establish a Bureau of Medical Marijuana Regulation and regulate such activities as cultivation and dispensary licensing.

The bills, which take effect in 2018, "establish a long-overdue comprehensive regulatory framework for the production, transportation and sale of medical marijuana," Brown, a Democrat, said in a signing statement on Friday. "This new structure will make sure patients have access to medical marijuana, while ensuring a robust tracking system."