A state appeals court affirmed the legality of medical marijuana dispensaries under California law and rejected bans imposed by municipalities.

A three-justice panel of the 2nd District Court of Appeal held Monday that Los Angeles County's ban on medical marijuana is "preempted" by state law. The decision reverses a preliminary junction granted to the county by Los Angeles Superior Court Judge Ann Jones in May 2011. On July 24, the city of Los Angeles is similar to the one enacted by the County, but just rejected by the court of appeal.

"Los Angeles County's total, per se nuisance ban against medical marijuana dispensaries directly contradicts the legislature's intent," Justice Robert Mallano wrote in the 19-page unanimous decision. Joe Elford, Chief Counsel with Americans for Safe Access, said the ruling put a "major wrennch" in City Attorney Carmen Trutanich's effort to ban medical marijuana dispensaries in Los Angeles.

"The court of appeal could not have been clearer in expressing that medical marijuana dispensaries are legal under state law, and that municipalities have no right to ban them," said Joe Elford, Chief Counsel with Americans for Safe Access, a medical marijuana advocacy group. "This landmark decision should have a considerable impact on how the California Supreme Court rules in the various dispensary cases it's currently reviewing." While the ruling will do doubt be welcomed by many in the medical marijuana community, it still does not make them safe from being raided and/or forcibly closed.

As the Associated Press put it Tuesday, referring to Monday's court ruling, which revolved around Alternative Medicinal Cannabis Collective, a medical marijuana facility in the City of Covina against which a lower court gave L.A. County an injunction in 2011—wrongfully, in the appeals court opinion: