Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Local governments in California have legal authority to ban storefront pot shops within their borders, California's highest court ruled on Monday in an opinion likely to further diminish the state's once-robust medical marijuana industry.

Nearly 17 years after voters in the state legalized medical marijuana, the court ruled unanimously in a legal challenge to a ban the city of Riverside enacted in 2010.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The advocacy group Americans for Safe Access estimates that another 200 jurisdictions statewide have similar prohibitions on retail pot sales. Many were enacted after the number of retail medical marijuana outlets boomed in Southern California after a 2009 memo from the U.S. Justice Department said prosecuting pot sales would be a low priority.

However, the rush to outlaw pot shops has slowed in the 21 months since the four federal prosecutors in California launched a coordinated crackdown on dispensaries by threatening to seize the property of landlords who lease space to the shops. Hundreds of dispensary operators have since been evicted or closed voluntarily.

Marijuana advocates have argued that allowing local government to bar dispensaries thwarts the intent of the state's medical marijuana law — the nation's first — to make the drug accessible to residents with doctor's recommendations to use it.

The ruling came in the case filed after Riverside city lawmakers used zoning powers 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.

A number of counties and cities were awaiting the Supreme Court ruling before moving forward with bans of their own.

A mid-level appeals court previously sided with the city of Riverside, but other courts have come to opposite conclusions. Last summer, a trial judge ruled that Riverside County could not close medical marijuana dispensaries in unincorporated areas because the move did not give the shops any room to operate legally under state law.

Meanwhile, an appeals court in Southern California struck down Los Angeles County's 2-year-old ban on dispensaries, ruling state law allows cooperatives and collectives to grow, store and distribute pot.