A Colorado city is headed to federal court over a ban on the sale and possession of guns deemed to be “assault weapons” as well as bump stocks and magazines capable of holding more than 10 rounds.

The Mountain States Legal Foundation, a nonprofit public interest law firm based in Lakewood, Colorado, filed a legal challenge to Boulder’s new local regulations on firearms. The foundation named virtually the entire city government from the mayor and city manager to the city council and chief of police as defendants, arguing the ordinance violates not only the state and U.S. Constitution but also at least two Colorado statutes.

“This ban is tantamount to Boulder attempting to stop drunk driving by banning Subarus,” said Cody J. Wisniewski, an attorney with the firm. “It accomplishes nothing other than making criminals of law-abiding citizens.”

Boulder’s ban goes after virtually all semi-auto firearms in one form or another. Rifles capable of taking a detachable magazine holding 21 or more rounds, or a shotgun that can accommodate more than six shells, if they have a semi-auto action, are outlawed. A similar restriction applies to pistols or any gun that can be modified to meet the new definition. Bump stocks and detachable magazines capable of holding more than 10 rounds are likewise banned. Local residents have until July 15 to remove the newly regulated arms and devices from town or apply for a certificate from the city to grandfather them.

The ordinance, contends the lawsuit, violates the Second, Fifth and 14th Amendments as well as Colorado preemption laws and prohibitions against maintaining a firearms registry.

“The West wasn’t won with a registered gun,” said William Perry Pendley, the foundation’s president. “Colorado is not California; these laws have no place here.”

The plaintiffs in the litigation include Boulder icon Jon Caldara, a well-known libertarian activist and radio host; the Boulder Rifle Club; area gun shop Bison Tactical; and University of Colorado Shooting Team member Tyler Faye.

City leaders cited the Heller ruling from the U.S. Supreme Court as legal justification for their ban before their unanimous vote to enact it.

“The point here is that this Supreme Court opinion from 2008 makes it very clear that we can regulate weapons designed primarily for human destruction,” said Council Members Sam Weaver and Bob Yates in an opinion piece for the Boulder Daily Camera. “Likewise, courts in Colorado have upheld a similar gun ban by Denver, stating that local control of health and safety trumps state preemption on gun control. For these reasons, we are confident that Boulder’s narrowly-tailored ordinance will survive legal scrutiny.”

Weaver and Yates went on to say that, “High-quality lawyers are lining up to represent the city pro bono in any legal challenge of the ordinance, and we believe that the cost and distraction of any lawsuit will be minimal. If we avoided taking action every time someone threatened to take us to court, everyone would threaten to take us to court.”