SAN FRANCISCO - A bill aimed at providing a framework for overseeing and regulating California's notoriously free-wheeling medical marijuana industry squeaked out of the state Assembly on Thursday despite opponents' claims that the measure would cause pot shops and farms to proliferate rather than face greater accountability.

Assemblyman Tom Ammiano's AB2312 would for the first time require marijuana dispensaries, growers, delivery services and manufacturers of pot products to register with the state and be overseen by an appointed nine-member board. It also would compel cities and counties to authorize one dispensary for every 50,000 residents unless local officials or voters approve a ban on pot shops.

The measure was modeled after a ballot initiative that medical marijuana advocates crafted last winter after the four federal prosecutors based in California launched a coordinated crackdown on dispensaries and growers they maintained were operating as fronts for illegal drug trafficking. Caught up in the renewed offensive were several suppliers who had been lauded by state and local officials for their strict compliance with the state's 16-year-old medical marijuana law.

If approved by the Senate and signed into law by Gov. Jerry Brown, the bill would represent the first major overhaul to that law in eight years.

"Today's vote was significant because it represents a considerable shift that the Legislature is now willing to take responsibility for the effective regulation of medical cannabis in California," Ammiano, a San Francisco Democrat, said. "With the continuing federal crackdown, we simply cannot afford to continue keeping our heads in the sand and pretend that everything is fine."

Before the measure passed the Assembly with the minimum number of 41 votes, several opponents said they did not believe marijuana has legitimate medical uses. Fresno Republican Linda Halderman, a doctor and surgeon, called medical marijuana "a phrase that is meaningless" and discussions about it a debate over "whether people should be able to legally get high."

Irvine Republic Don Wagner warned that creating a system of state oversight could expose government employees charged with carrying out the program to federal drug charges. Wagner also objected to the proposed makeup of the Board of Medical Marijuana Enforcement, which would include a doctor familiar with medical marijuana, two medical marijuana patients and an industry representative.

"Something smells when you stack the deck like that, and we know what that smell is," he said.

Ammiano accused his colleagues of being out of touch with the views of Californians, whom public opinion polls show support making medical marijuana available with adequate controls.

Concord Democrat Susan Bonilla agreed with Ammiano that there needs to be a statewide regulatory scheme so the job of policing and working with medical marijuana businesses does not fall only to local governments.

"What it does is begin the process of regulation of something that is happening anyway," she said.