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 another 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 that 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 only for 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.

Activists also are in the early stages of planning a ballot initiative that would legalize the recreational use of marijuana and regulate it like alcohol, as voters in Washington and Colorado did last year.

Although California is believed by advocates and law enforcement agencies to have had thousands of dispensaries a few years ago, the number has dropped significantly as communities and federal authorities have cracked down. However, counting with any precision is impossible because record-keeping varies from community to community, many dispensaries do not advertise, and no overall state total is kept.

Marijuana remains illegal under federal law, and the U.S. attorneys have threatened to seize the property of landlords who lease space to the shops. Hundreds of dispensary operators have since been evicted or closed voluntarily.

Riverside city lawmakers used their zoning authority to declare storefront pot shops as public nuisances and ban the operations in 2010. The Inland Empire Patient's Health and Wellness Center, part of the explosion of retail medical marijuana outlets, sued to stop the city from shutting it down.

Larry Swerdlow, a nurse who co-founded the Inland Empire center and a neighboring clinic where people can obtain recommendations to use marijuana, said Monday that banning dispensaries would force residents to get the drug on the street. He also pledged to keep fighting.

"I kind of look at the gay community. I mean, they had lost all these elections on gay marriage, 40 states and this kind of stuff, but they didn't give up," Swerdlow said as medical marijuana activists gathered at the state Capitol to lobby lawmakers on the two proposed bills. "We're not going to give up either."

Medical marijuana supporters in several cities, including San Diego, San Jose and Los Angeles, have stopped officials from either outlawing or limiting pot shops by threatening to overturn them with voter referendums.