SACRAMENTO, Calif. (AP) -- California would take steps to regulate the sale of medical marijuana under a bill approved Monday by the state Senate, restricting cannabis dispensaries that federal prosecutors say have grown out of control.

California voters first supported legalizing marijuana to treat illness in 1996, but federal prosecutors recently cracked down. They said the industry has grown enormously profitable and has made marijuana essentially available for recreational use.

The Senate sent the bill to the Assembly on a 22-12 vote and without any Republican support.

The legislation makes it clear that dispensaries cannot operate at a profit, but that the owners can receive reasonable compensation and reimbursement for expenses.

"This bill is not about the legalization of marijuana," said Senate President Pro Tem Darrell Steinberg, D-Sacramento. "It does seek to assure that patients who need medical cannabis have access to it. It is intended to assure that drug cartels and other criminals do not benefit from the lack of regulation."

He said his SB439, along with pending legislation by Assemblyman Tom Ammiano, D-San Francisco, is "intended to come to some sort of an understanding with the federal government."

The bill's language is still being negotiated with law enforcement groups and is likely to be amended in the Assembly, Steinberg said.

It would not affect local regulations or prohibitions on dispensaries, authority that the state Supreme Court upheld earlier this month.

The bill would adopt guidelines issued by Gov. Jerry Brown when he was the state's attorney general in 2008, making it clear that the dispensaries cannot operate at a profit. Those operating within the guidelines could not face state prosecution.

Under Brown's 2008 guidelines, cooperatives registered under the state's Food and Agricultural Code or organized as less formal "collectives" are legal under California law, while for-profit dispensaries are not.

But there is lingering confusion over what is permitted in California, as indicated by the three competing medicinal marijuana measures that Los Angeles voters will consider on Tuesday's municipal ballot. The measures would either limit the number of dispensaries or allow new ones to open.

Sen. Jim Nielsen, R-Gerber, said California voters never intended to create the wide open marijuana industry that has evolved from the 1996 initiative, which since has created such headaches that 200 cities have outlawed or restricted dispensaries.

"The public thought it was, like, terminally ill or very seriously ill individuals, and now it's almost carte blanche for everybody and these marijuana dispensaries are popping up everywhere...." Nielsen said. "It's a gateway drug into great profits that many criminals have utilized to prey upon our public."

But Sen. Mark Leno, D-San Francisco, said nearly 50 California cities have opted to let dispensaries operate under the 2008 guidelines. The idea that marijuana should be available to those who are sick continues to have wide support both in California and across the nation, he said.

Aside from the restrictions on profits, the 2008 guidelines also said dispensaries should track their members and product and take steps to discourage the marijuana from going to those without a legitimate medical need. Steinberg's bill would put those non-binding guidelines into state law.

"The idea that...everyone has to have the wherewithal and the ability and the physical stamina as a patient to be able to grow their own is just unreasonable and unworkable," Leno said. "This is a very sensible step."