Barely a week after taking effect, a novel state law that makes it easier for gun-rights groups to challenge local firearms measures in court is already sparking change: Nearly two dozen Pennsylvania municipalities have agreed to get rid of their potentially problematic ordinances rather than face litigation.

Joshua Prince, an attorney for four pro-gun groups and several residents, cited the new law in putting nearly 100 Pennsylvania municipalities on notice that they would face legal action unless they rescinded their firearms laws.

At least 22 of those municipalities have already repealed them, or indicated they planned to do so, according to Prince, who specializes in firearms law and is based in southeastern Pennsylvania.

Pennsylvania, which has a strong tradition of hunting and gun ownership, has long prohibited its municipalities from enforcing firearms ordinances that regulate the ownership, possession, transfer or transportation of guns or ammunition.

Gun-rights groups complained that scores of municipalities have ignored the 40-year-old prohibition by passing their own, mainly unchallenged gun measures.

Under the new state law, gun owners no longer have to prove they have been harmed by the local measure to successfully challenge it, and "membership organizations" like the National Rifle Association can stand in to sue on behalf of any Pennsylvania member. The challenger can also seek damages.

At least one other state, Florida, also permits a membership organization to file suit over local gun regulations.

The cities of Philadelphia, Pittsburgh and Lancaster have sued to overturn the Pennsylvania law, saying the legislation was passed improperly. That lawsuit is pending in Commonwealth Court.

Shira Goodman, executive director of CeaseFirePA, is encouraging municipalities with gun laws to stand pat, at least until the legal challenge is resolved.

"We certainly understand that they feel threatened and concerned. We feel like they have been put in a terrible position by their representatives in Harrisburg," she said.

Reading City Council signaled last week it intended to repeal laws that ban firing weapons within city limits and require owners to report lost or stolen weapons. Officials said the city could ill afford a legal battle.

"We get ourselves in trouble in terms of trying to circumvent a state law," said Councilman Jeff Waltman. "We're not going to solve this with a local gun law anyway."

The city of Harrisburg plans to defend its ordinances, asserting they comply with state law. The measures ban gunfire anywhere in the city and weapons possession in city parks. There's also a reporting requirement for lost or stolen weapons.

Harrisburg's laws are intended to combat gun violence and have the support of the police chief, said Mayor Eric Papenfuse.

"I don't think it's the be-all and end-all of public safety, but I think it's an important tool to have, and it absolutely sends the wrong message to try to rescind those ordinances, especially given the epidemic of gun violence we have in cities like Harrisburg," he said.

Papenfuse denounced the new state law as representing "a fringe ideological view."

But gun activist Dave Dalton said no municipality has a right to flout Pennsylvania law. He said the law gives gun owners a tool to hold municipalities accountable.

"What gives a town or a city the authority to say, 'We're in Pennsylvania, but we don't care about Pennsylvania law?' It's laughable," said Dalton, founder of American Gun Owners Alliance in the Pocono Mountains, one of the groups represented by Prince.

The local laws have violated gun owners' rights without making anyone safer, said another of Prince's clients, Kim Stolfer, founder of Firearms Owners Against Crime.

"I think all of us are pleased it's a good start, that communities are starting to look at this," Stolfer said. Before gun groups were given standing to sue, he said, municipal officials "were just going to thumb their nose at a system that wasn't going to hold them responsible."

The NRA has not yet contacted any municipality, but said it's reviewing local ordinances to ensure they comply with Pennsylvania law.