The National Rifle Association is taking on three Pennsylvania cities over gun restrictions that the NRA says violate a state law on the books for decades.

Philadelphia, Pittsburgh and Lancaster all have laws that regulate gun ownership in some way, including requirements that owners report lost or stolen firearms, prohibitions on guns in city-owned facilities and restrictions on gun possession by anyone subject to a protective order.

Pittsburgh law prohibits gun owners from carrying firearms in a vehicle, and bans firing any guns except at licensed target ranges.

Those laws are preempted by a 1974 state law that bars cities from setting their own gun policy. But state courts have thrown out previous lawsuits because of a requirement that plaintiffs show harm done by existing city laws.

That is, until the Republican state legislature stepped in: Last year, legislators passed a new law allowing any Pennsylvania gun owner, or a group with members in Pennsylvania — like the NRA — to challenge local ordinances. If the challenge is successful, the losing cities would be on the hook for the plaintiff’s legal costs.

Nearly two dozen Pennsylvania towns and cities repealed their gun ordinances after Gov. Tom Corbett (R) signed the bill into law. But Philadelphia, Pittsburgh and Lancaster did not.

“The cities of Pittsburgh, Philadelphia, and Lancaster have openly defied state law for decades. They continue to willfully violate the law and insist on politically grandstanding at taxpayers’ expense,” Chris Cox, the NRA’s top lobbyist, said in a statement announcing the lawsuits.

But the legality of the new law, Act 192, is being challenged. Lawyers for all three cities say the law violated Pennsylvania’s single-subject rule, and that giving standing to groups like the NRA is unconstitutional in and of itself. Any lawsuit over the city ordinances will likely require higher courts to rule on the Act before going to trial.

“We will not be deterred and we will keep our lawsuit going against the unconstitutional act passed in Harrisburg,” Pittsburgh Mayor William Peduto told reporters on Wednesday. “It is unconstitutional, it never should have been passed, and it breaks with more than 200 years of history in Pennsylvania, by allowing organizations without standing the ability to sue.”

The state Supreme Court has ruled against other Pennsylvania gun restrictions in the past. In 2010, it rejected a Philadelphia ordinance that would have limited gun purchases by an individual to one a month, and another that banned assault weapons.