Faced with the rapid expansion of medical marijuana dispensaries across Los Angeles, the City Council voted this afternoon to close a loophole in the moratorium that had inadvertently prevented city officials from taking legal steps to close those that have opened since the ban.

The action, which comes months after city officials became aware of the glitch, means that the city attorney’s office will be able to file criminal or civil complaints against operators who fail to follow city orders to shut down. It will be at least a week before the council takes a final vote.

“We know that time is passing. We’ll close the loopholes, plug these floodgates,” said Councilman Ed Reyes, chairman of the committee that is developing an ordinance that will govern how the city controls the distribution of medical marijuana. “We’re taking very strong steps today.”

The action was proposed by Councilman Jose Huizar after he received complaints from residents of Eagle Rock, where numerous dispensaries have opened after the moratorium was approved in 2007. He said that that people were “putting up these fly-by-night operations knowing full well they could make a quick buck while they can operate under this loophole.”

The hearing drew a raucous crowd of neighborhood activists, who asked the council to support the measure to clamp down on dispensaries, and medical marijuana activists and patients, who urged the council not to hinder access to a drug that has been shown to effectively treat pain and other ailments.