Nearly 180 cities across the state have banned dispensaries, and lawsuits challenging the bans have reached the State Supreme Court. In more liberal areas, some 50 municipalities have passed medical marijuana ordinances, but most have suspended the regulation of dispensaries because of the federal offensive, according to Americans for Safe Access, a group that promotes access to medical marijuana. San Francisco and Oakland, the fiercest defenders of medical marijuana, have continued to issue permits to new dispensaries.

In 2004, shortly after the state effectively allowed the opening of storefront dispensaries, there were only three or four in Los Angeles, experts said. The number soon swelled into the hundreds before the city imposed a moratorium. But dispensaries continued to proliferate by exploiting a loophole in the moratorium even as lawsuits restricted the city’s ability to pass an ordinance. Over the summer, the City Council voted to ban dispensaries.

Anticipating the ban, the medical marijuana industry “that historically had not worked together very well” began organizing a counterattack, said Dan Rush, an official with the United Food and Commercial Workers Union, which formed a coalition with Americans for Safe Access and the Greater Los Angeles Collective Alliance, a group of dispensary owners. The coalition raised $250,000, mostly from dispensaries, to gather the signatures necessary to place a referendum to overturn the ban on the ballot next March, said Don Duncan, California director for Americans for Safe Access.

Instead of allowing the referendum to proceed in March, when elections for mayor and City Council seats will also be held, the council on Tuesday voted to simply rescind the ban. José Huizar, one of only two council members to vote against the repeal, and the strongest backer of the ban, said the city was not in a position to fight an increasingly well-organized industry.

Mr. Huizar said California’s medical marijuana laws, considered the nation’s weakest, must be changed to better control the production and distribution of marijuana, as well as limit access to only real patients.

“Unless that happens, local cities are going to continue to play the cat-and-mouse game with the dispensaries,” he said, adding that the industry had fought attempts here to regulate it. “These are folks who are just out to protect their profits, and they do that by having as little regulation or oversight as possible by the City of Los Angeles.”