HARRISBURG - In the final minutes of the legislative session, the House on Monday approved a bill clearing the way for the National Rifle Association and other groups to sue local municipalities, among them Philadelphia, that enact ordinances stricter than state firearms laws.

The bill, approved by a 138-56 vote, will grant legal standing to "membership organizations" to sue over local gun laws, and collect legal fees and other costs if they win.

Mayor Nutter said Monday before the vote that he was "profoundly opposed" to the bill, which he said increases the vulnerability of municipalities trying to combat gun violence to lawsuits by pro-gun advocates.

Gov. Corbett will sign the bill, said spokesman Jay Pagni. The Senate approved it Thursday.

"The Supreme Court has been clear in previous case law that local ordinances cannot supersede state law," Pagni said.

Some gun-related ordinances in Pittsburgh and Philadelphia, including those aimed at curbing "straw" purchases, which require residents to report lost and stolen firearms, have stood up to legal challenge.

In several cases, courts found that plaintiffs - including individuals and the NRA - did not have standing to sue.

"Gun violence represents a particularly tragic epidemic in poorer communities in cities like Philadelphia and Pittsburgh," said Nutter in a joint statement with Pittsburgh Mayor William Peduto. "Parents, family members, and community leaders are naturally compelled by concern for their loved ones to do everything in their power to combat the shootings that destroy lives. It is squarely at some of these responses by the community that H.B. 80 is now aimed."

About 28 other municipalities, including 10 in the Philadelphia suburbs, have their own ordinances on lost and stolen firearms. An additional 19 have resolutions supporting mandatory reporting.

"This is a dangerous provision that threatens municipalities' financial stability," said Rep. Madeleine Dean (D., Montgomery), who represents Abington, which passed a lost and stolen resolution.

Boroughs, townships, and cities across the state, including at least nine in Southeastern Pennsylvania, began enacting local ordinances aimed at cracking down on illegal gun trafficking in 2008 after the General Assembly did not act on a statewide measure to crack down on straw purchases.

The bill, which will take effect 60 days after it is signed, would also require that if a lawsuit is filed against a municipality and succeeds, the municipality must pay all legal fees and costs for the plaintiffs.

Opponents say the bill blows up the definition of "standing," which stipulates that there must be a victim identified, and creates a dangerous precedent.

"If you are a resident of Forest County and you don't like the Norristown gun law," said Sen. Daylin Leach (D., Montgomery), "you could hire Johnnie Cochran and bill a township $100,000 an hour or whatever he charges to win the case."

Bill supporters said the state constitution already establishes that firearms laws must be uniform, that changes are to be made by the General Assembly, and that existing local laws are unconstitutional.

"We can't have a crazy quilt of laws," said Rep. Jeff Pyle (R., Armstrong).

Former Gov. Ed Rendell, a gun control advocate who has worked with the advocacy group CeasefirePA, has vowed to target in the Nov. 4 election Southeastern Pennsylvania lawmakers who voted for the measure.

"This bill is outrageous," Rendell said last week. "People all over the commonwealth support the basic notion that someone who loses their firearm should report it."