Updated

Around 440 self-described medical marijuana dispensaries across Los Angeles were under orders to close on Monday, nearly five months after city officials voted to shut most of them down.

An estimated 135 dispensaries may remain legally open as of Monday as a new city law formally takes effect. City leaders hope to eventually whittle that number down to 70 and confine them to mostly industrial areas, away from schools, parks, libraries and churches.

"We're trying to achieve some order out of what has essentially been a very chaotic situation," Assistant City Attorney Asha Greenberg told Reuters in an interview.

"We will have a limited number of medical marijuana establishments that are not close to sensitive sites and are not neighborhood nuisances," she said

Greenberg said that 439 shops had been ordered to close. Any remaining open after Monday face law enforcement actions.

"As of today they should have their boxes packed and their closed sign up," she said.

California became the first U.S. state to decriminalize cannabis for medical use in 1996 and a 2003 ballot measure permitted pot to be cultivated and distributed to patients holding prescriptions from a doctor. Since those developments, Los Angeles had seen roughly 1,000 of the shops spring up across the city.

Responding to residents who complained that many of the shops were catering more to recreational pot smokers than patients, the Los Angeles City Council voted in January to limit the number that could operate to between 70 and 187.

Legal challenges failed to stop the law taking effect.

Since the city council passed its law, a statewide voter initiative that would legalize the possession and sale of marijuana has qualified for the November ballot in what supporters have called a "watershed moment" for their cause.

It was unclear how that measure would affect Los Angeles' ability to regulate medical marijuana, should it pass.

Under the ballot initiative, simple possession of an ounce (28.5 grams) or less of marijuana, currently a misdemeanor punishable by a $100 fine, would be legal for anyone aged 21 or older. It also would be lawful to grow limited amounts in one's own home for personal use.

While sales would not be legalized outright, cities and counties could pass laws permitting commercial distribution subject to local regulations and taxes. Retail sales would still be limited to an ounce for adults 21 and older.