The Los Angeles city attorney filed a lawsuit Thursday asking a judge to support the city's move to shut down more than 130 medical marijuana shops under a new ordinance.

The city clerk determined that only 41 pot shops comply with the ordinance, surprising city officials who aimed to allow 70 clinics in the city.

The countersuit asks a judge to determine that the city's interpretation of the ordinance was appropriate.

The new law passed in January and seeks to regulate the clinics, hundreds of which popped up after officials failed to enforce a 2007 moratorium on medical pot clinics.

The regulations require dispensaries to have been registered with the city previously and owners to pass a background check.

Later the Building and Safety Department will inspect the dispensaries' locations to make sure they are 1,000 feet from schools, parks and other gathering sites, city attorney spokesman Frank Mateljan said. Each dispensary's pot must be tested at an independent lab.

Mateljan said his office won't try to close any clinics before the court rules.

He said 132 clinics were ineligible because of a change in ownership or management. Other shops were ineligible because they moved more than once or their owners didn't complete or pass a background check.

About 30 lawsuits have already been filed challenging the city's process of evaluating clinics. Most were filed by some of the 400 ordered to shut down in June when the ordinance went into effect.

"They're going beyond a strict interpretation of the ordinance and doing anything they can to figure out how they can disqualify them," said James Shaw, who runs a downtown pot clinic and represents the Union of Medical Marijuana Patients. "This is not what the city council intended. The city attorney wants to shut everyone down."

More clinics will be chosen by lottery to bring the total to 70, Mateljan said.

"This is simply the initial qualifying round," he said. "The spirit of the law will be upheld by the time we get to the end of the process. We're moving very deliberately to strike a balance between allowing access to medical marijuana and making sure the laws of the city are upheld."

(This version CORRECTS Corrects number of clinics ordered to shut down. Updates with details, quotes.)