The state attorney general’s office today struck down Wakefield’s ban on medical marijuana dispensaries, ruling that towns can regulate, but not prohibit the centers under state law.

Such bans would frustrate the purpose of the medical marijuana law, passed by referendum last fall, that allows patients with certain medical conditions to obtain marijuana for medical use, the ruling said.

“The act’s legislative purpose could not be served if a municipality could prohibit treatment centers within its borders, for if one municipality could do so, presumably all could do so,’’ the office said.

Wednesday’s ruling addressed only Wakefield’s prohibition. Other Massachusetts communities have also approved bans, fearing the centers would spur an increase in crime. Other communities have focused on limiting where the centers can operate.


In a separate decision, the attorney general’s office approved Burlington’s temporary moratorium on medical marijuana treatment centers, which bans such centers until mid-2014.

Geoffrey Beckwith, executive director of the Massachusetts Municipal Association, said the attorney general’s ruling allowing cities and towns to adopt moratoriums on medical marijuana treatment centers sends a clear signal that communities can retain control over many aspects of the contentious issue.

“Certainly the door is open, and we believe wide open, for communities to be able to regulate this,’’ Beckwith said. “For example, they will be able to prescribe the locations where a facility could be allowed or not allowed, for example not in a residential area, not near schools, not in a downtown commercial district.’’

The association continues to push for a six-month delay, until Oct. 1, in implementing the law, because most communities do not hold town meetings or elections until later this spring, making it difficult for them to enact bylaws before the new marijuana rules are scheduled to go into effect.

State public health regulators today announced that they will release draft regulations of the rules on March 29, hold public hearings on April 19, and vote on the final rules May 8. If approved those rules will go into effect May 24.