The California Supreme Court ruled Monday that cities and counties can ban medical marijuana dispensaries, a decision likely to further diminish the network of storefront pot shops and fuel efforts to have the state regulate the industry.

In a unanimous opinion, the court held that California’s medical marijuana laws — the nation’s first and most liberal — neither prevent local governments from using their land-use powers to zone dispensaries out of existence nor grant authorized users convenient access to the drug.

“While some counties and cities might consider themselves well-suited to accommodating medical marijuana dispensaries, conditions in other communities might lead to the reasonable decision that such facilities within their borders, even if carefully sited, well managed, and closely monitored, would present unacceptable local risks and burdens,” Justice Marvin Baxter wrote for the seven-member court.

The ruling came in a legal challenge to a ban enacted by the city of Riverside in 2010, but an additional 200 jurisdictions have similar prohibitions on retail pot sales, the advocacy group Americans for Safe Access estimates. Many were enacted in the past five years as the number of dispensaries swelled and amid concerns the drug had become too easy to get. A number of counties and cities were awaiting the Supreme Court ruling before moving forward with bans of their own.

Of the 18 states that allow the medical use of marijuana, California is the only one where residents can obtain a doctor’s recommendation to consume it for any ailment the physician sees fit, as opposed to for only conditions such as AIDS and glaucoma. The state also is alone in not having a system for regulating growers and sellers.

“The irony in California is that we regulate everything that consumers purchase and consume, and somehow this has been allowed to be a complete free-for-all,” said Jeffrey Dunn, the lawyer who represented Riverside in the successful defense of its ban. “Cities and counties looked at this and said, ‘Wait a minute. We can’t expose the public to these kind of risks,’ and the court recognized that when it comes to public safety, we have independent authority.”

Marijuana advocates had argued that allowing local governments to bar dispensaries thwarts the intent of the medical marijuana law that voter’s passed nearly 17 years ago. On Monday, they blamed the absence of state oversight and the failure of local authorities to adopt operating guidelines that fall short of banning dispensaries for the court’s decision.

“Today’s decision allowing localities to ban will likely lead to reduced patient access in California unless the state finally steps up to provide regulatory oversight and guidance,” said Tamar Todd, senior staff attorney for the Drug Policy Alliance. “Localities will stop enacting bans once the state has stepped up and assumed its responsibility to regulate.”

Two bills are pending in the California Legislature that seek to establish a new statewide system for regulating and licensing the medical marijuana industry, and to clarify the role of dispensaries in it. Advocates hope to see language that would make it harder for local governments to outlaw dispensaries by requiring voter approval for any bans, Drug Policy Alliance Policy Manager Amanda Reiman said.