Days after 11 worshippers were gunned down by an anti-Semite wielding an AR-15 at a synagogue in Pittsburgh, Mayor Bill Peduto urged the City Council to pass new laws regulating access to high-powered weapons. This week, Peduto followed up his plea with emails to dozens of mayors across the country urging them to do the same — even though it would probably result in lawsuits.

That’s because Pennsylvania, like 44 other states, has a “preemption” law prohibiting local governments from enacting gun regulations that are stricter than those passed by state legislatures.

This way of restricting local law-making was pioneered by tobacco companies looking to head off regulation in the 1960s and ‘70s. But in the last few decades, the National Rifle Association, through its supporters in state legislatures, has repeatedly used preemption to successfully block gun reform efforts. And the threat of lawsuits against cities that run afoul of the legislation has had a chilling effect on local lawmakers across the country, even in deep blue states like California.

We’ve reported on preemption several times at The Trace, but many Americans might not realize how the NRA has worked to dilute the authority of local lawmakers. Through Ask The Trace, a special project driven by the curiosity of readers, Barbara Finch asked us, “How can cities work around state preemption laws that apply to guns?”

Here’s the background on this the well-funded effort to block local gun reform, and the burgeoning movement to beat it back.

What exactly is preemption?

Preemption, in the constitutional context, refers to the pecking order of legislation: Federal trumps state, and, in much of the United States, states trump municipalities when it comes to gun regulation. A typical preemption law says that the state legislature occupies “the whole field” of firearms regulation, and declares municipal ordinances, like bans on assaults weapons or mandatory reporting of stolen guns, “null and void.”

Critics of these laws say that local lawmakers know what’s best in terms of public safety. The NRA argues that states need a uniform system of gun regulations, and not “a confusing patchwork of gun control laws” that varies from jurisdiction to jurisdiction. Todd Rathner, a lobbyist for the Arizona State Rifle and Pistol Association, told us in 2016 that local governments are exceeding their authority when trying to pass their own regulations. “This is about an overall pattern of abuse,” he said.

Gun regulation isn’t the only thing that’s off limits to local lawmakers. Some states specifically forbid the creation of local laws around fracking, minimum wage hikes, sick leave, soda taxes, and non-discrimination protections for LGBTQ people. But none of those efforts have been as successful as gun law preemption.

The gun lobby began using preemption as a tool in 1981, when local officials in Morton Grove, Illinois, passed a handgun ban. The village hoped the move might inspire their counterparts across the country to pass similar bans. But local gun rights groups sued, and the NRA used the publicity to mobilize its members to push for state preemption laws. The NRA then hit on a strategy it still employs today: teaming up with state-based gun rights groups to challenge local gun laws in court. Since then, dozens of cities have been forced to scrap their laws, making preemption one of the NRA’s hallmark legislative strategies.

How many states have preemption statutes for firearms?

Currently 44 states preempt localities from enacting their own gun laws. That includes such gun reform strongholds as Washington State and Maryland. California has a law that preempts local governments from handling gun permitting and registration, but allows cities and towns to broadly regulate guns.

The five states that allow cities to enact their own gun laws without restriction — Connecticut, Hawaii, Massachusetts, New Jersey, and New York — are also the states with the lowest rates of gun death.

How is preemption enforced?

Through litigation. Gun groups can sue local governments and argue that their firearms ordinances violate a state’s preemption law. These lawsuits are costly, and often compel cash-strapped municipalities to abandon their gun ordinances rather than risk a huge payout. The most punitive preemption laws force cities that lose their court battles to pay plaintiffs’ legal fees.

Four years ago, after Pennsylvania passed a law allowing outside groups like the NRA to sue over preemption, nearly 100 municipalities scrambled to roll back their gun regulations. “We’re basically being forced to repeal these laws at gunpoint,” Det Ansinn, the president of the Doylestown Borough Council, said at the time. And last fall, as cities across the country considered passing bump stock bans after the Las Vegas massacre, the City Council in Tucson backed down from crafting its own ban after the city attorney told local lawmakers that their hands were tied by preemption.

Some preemption laws go so far as to punish individual lawmakers for spearheading gun laws. In Arizona and Florida, local officials can be subjected to fines, and in five states — Florida, Iowa, Kentucky, Minnesota, and Mississippi — they can be personally sued and ordered to pay damages and attorneys’ fees to the winning side. In most cases, that’s the NRA or its local affiliates.

Do cities ever defeat the gun lobby in court?

Yes. In 2017, a Florida appeals court upheld Tallahassee’s gun ordinances, which made it illegal to fire guns in city-owned or operated parks. In October, a Montana judge rejected an opinion from the state attorney general and upheld Missoula’s 2016 universal background check ordinance, which the Montana Shooting Sports Association and the NRA had sued to overturn. While Montana law may preempt gun regulations, Missoula adopted a self-government charter in 1997 that imbues the city with the authority to craft its own regulations, the judge ruled.

Have any states ever overturned or relaxed their preemption statutes?

The portion of Pennsylvania’s preemption statute that allowed outside groups, like the NRA, to sue cities that enact new gun laws was overturned on a technicality.

Tennessee last year gave municipalities the authority to keep guns out of public buildings, parks, and buses. But it came with a strict set of NRA-endorsed rules: Cities that choose to ban guns in those places are required to erect metal detectors and hire security guards. The change was opposed by local authorities, who argued that it would impose huge costs on cities that want to limit guns in public.

The day after the school massacre in Parkland, Florida, Democratic state lawmakers in Kentucky filed a bill that would roll back the state’s preemption law, but it’s been stalled in committee for the last nine months.

So what’s next in this tug of war between city and state?

Several cities are waging court battles to retain their local ordinances. In May, Cincinnati and Columbus both voted to pass bump stock bans. The next month, two state-based gun groups filed suit against them. And in July, two weeks after the Seattle City Council passed a law imposing fines on gun owners who don’t safely store their weapons, the NRA and the Second Amendment Foundation filed suit against the city, as well as the mayor, police department, and police chief.

After Parkland, several cities began exploring bans on assault weapons and other restrictions on gun access only to find that their options were limited. Daniel Stermer, the mayor of nearby Weston, Florida, concluded that the only way to retain the authority to enact gun laws was to file a lawsuit to amend the state’s preemption law. Since then, mayors in more than a dozen cities have signed on, including Tallahassee, Miami Beach, and Orlando.

In April, the Chicago suburb of Deerfield, Illinois, banned assault-style weapons and high-capacity magazines. Less than 48 hours later, a local NRA affiliate sued to block the bans on the grounds that they violate the state’s 2013 preemption law, and a judge granted a temporary restraining order that prevented the ordinances from taking effect. A day before Boulder, Colorado’s ban on assault weapons, bump stocks, and high-capacity magazines took effect in June, the Colorado State Shooting Association filed suit. In response, City Council members made several changes to the measure. The regulations are now law, though litigation is ongoing.

But some local lawmakers are still fearful of lawsuits. Last month, officials in Palm Springs, California, rescinded a law requiring gun owners to report missing weapons to police within 48 hours. The NRA had been threatening to sue the city since the ordinance was first introduced.

Last month, Attorney General Mark Herring of Virginia announced a package of legislation aimed at combating violent extremism. Among the proposals is a measure that would amend state law to let local governments ban guns from permitted events, like political demonstrations. If Herring’s proposal becomes law, scholars say, it could set a precedent for giving towns and counties full authority to regulate guns.