The decision Wednesday by the three-judge Court of Appeal in Santa Ana marks the first to forbid cities to enact zoning restrictions that have the effect of banning all marijuana dispensaries, the Los Angeles Times reported.
But the court's stipulation the dispensaries sell only marijuana they grow would force most of them out of business, the Times said.
The appeals court struck down a zoning law in Lake Forest, Calif., that judges called "a total bar contradicting state law."
"A local government cannot ban as a nuisance exactly what the Legislature contemplated would occur at cooperative and collective medical marijuana cultivation sites," Justice Richard M. Aronson wrote for the court.
The Times said the decision conflicted with other appeals court rulings on medical marijuana and lawyers in the case said they expected the California Supreme Court would agree to hear an appeal.
David Welch, an attorney for a now-closed Lake Forest medical marijuana dispensary, said the ruling should send a message to cities that they should "not implement bans simply because that is the easy route."
Jeffrey Dunn, a lawyer who represented the city of Lake Forest, said most storefront dispensaries would be shut down because of the court's requirement dispensaries sell only marijuana grown on site.
"I don't see how you can grow in a tiny, rented space enough pot for over 1,000 customers," Dunn said.