Gun owners and California law enforcement officers are suing the city of Los Angeles, claiming its ban on high-capacity magazines violates state regulations.

The City Council voted in July to ban ownership of large-capacity magazines containing more than 10 rounds of ammunition. With gun owners facing a Nov. 18 deadline to give up the magazines, the suit seeks to block the law from going into effect.

Shasta County Sheriff Tom Bosenko, one of 30 sheriffs across the state who filed the lawsuit Friday, questioned how law enforcement agents would drive through the city when other parts of the state allow high-capacity magazines.

“The ordinance creates a patchwork of laws that law-abiding citizens and law enforcement have to navigate through,” Bosenko said.

The California Rifle and Pistol Association, which is the state-affiliated group of the National Rifle Association, and the California Reserve Peace Officers Association also joined the lawsuit.

Since 2000, California has outlawed manufacturing or selling high-capacity magazines, but Los Angeles’ ordinance goes further, making it illegal to possess them.

Cities including Sunnyvale and San Francisco also ban possession of high-capacity magazines and have successfully fended off lawsuits from the NRA.

Los Angeles City Councilman Paul Krekorian led his council colleagues this summer in passing the ban. At a July news conference, he cited several local incidents in which semi-automatic weapons were used, including the 1999 Los Angeles Jewish Community Center and 2013 Santa Monica College shootings.

Violation of the new ordinance carries misdemeanor charges.

Krekorian called the lawsuit a “predictable and desperate attempt by NRA lawyers to strike down a common-sense policy that will keep our city and its people safe.”

Los Angeles City Attorney Mike Feuer also criticized the lawsuit, stating the city’s law is constitutional.