The Los Angeles City Council reversed course Tuesday Octo­ber 2 and repealed a ban on pot shops that it passed just two months ago to shutter hundreds of medical marijuana storefronts.

Council members voted 11-2 to negate its July decision to rid the nation's second-largest city of pot dispensaries. The repeal came after opponents gathered enough signatures to place a referendum on the ballot seeking to undo the ban.

Many cities have struggled with medical marijuana ordinances, but none has had a bigger problem than Los Angeles, where pot shops have proliferated.

Though dispensary owners can now remain open without fear of local authorities, they still run the risk of getting shut down by federal authorities who last week started targeting stores in Los Angeles they said were raking in huge sums of money and attracting crime. Pot remains illegal under federal law.

“What weighs heavy in my mind is that no matter what we do, the federal government will still come in and shut them down,” said Councilman Ed Reyes, who voted for the ban in July. “It’s a very confusing time for everyone. Those who chose to continue to open up for the right reasons are at risk and those who are doing it out of gamesmanship, out of opportunism, out of profit at the cost of our lives and the public safety in our communities will also be at risk.”

The city’s so-called “gentle ban” would have eliminated storefront pot shops but allowed patients and caregivers to grow medical marijuana. City officials have said more than 750 collectives have registered with the city and as many as 200 more could exist.

More than 175 California cities and 20 counties have banned retail pot shops, according to the medical marijuana advocacy group Ameri­cans for Safe Access.

In supporting the repeal, some council members said they needed better guidance from California legislators and urged them to address the inadequacies of a state law that allows the medicinal use of marijuana with a doctor’s recommendation.

“We need to get clarity on exactly where we stand,” said Councilman Mitchell Englander.

The state Supreme Court is expected to address whether local governments can ban medical marijuana clinics, but a hearing hasn’t been set by the high court.

Los Angeles passed an ordinance two years ago that was supposed to shutter hundreds of pot dispensaries while capping the number in operation at 70.

But a set of legal challenges against the city by dispensaries and the recent expiration of the ordinance due to a sundowner clause led to another surge of pot shops.

Federal authorities have targeted about 375 pot stores and growing operations in the Central District of California, which stretches from Santa Barbara to San Bernardino counties.