Armed with a new state law, the National Rifle Association has sued Philadelphia, Pittsburgh, and Lancaster over gun-control measures each has adopted.

The three cities have "openly defied" a 40-year-old state law that forbids municipalities from regulating firearms, said Chris Cox, executive director of the NRA's Institute for Legislative Action.

Pennsylvania has long barred its municipalities from approving ordinances that regulate the ownership, possession, transfer, or transportation of guns or ammunition. But scores of cities and towns have ignored the prohibition, and gun-rights groups complained that the local measures were difficult to challenge because judges have ruled that plaintiffs could not prove harm.

Under a state law that took effect last week, gun owners no longer have to show they have been hurt by an ordinance to win in court. The new law also allows organizations such as the NRA to sue. Successful challengers can also seek legal fees and other costs.

Philadelphia, Pittsburgh, and Lancaster are fighting the law in court, contending lawmakers in Harrisburg didn't follow constitutional procedure for passing legislation.

Philadelphia officials have long said its measures - including ones that require owners to report lost or stolen firearms; prohibit guns from city-owned facilities; and ban weapons possession by people subject to protection-from-abuse orders or who are found to pose a risk of "imminent harm" to themselves or others - are needed to combat gun violence. The NRA is challenging those very laws.

Mayor Nutter's spokesman, Mark McDonald, said the city expects to prevail in its challenge to the new state law, and will be able to keep its "reasonable" gun-safety legislation.

Pittsburgh Mayor Bill Peduto said Wednesday the city "will not be deterred" by the NRA suit.