A state court on Thursday deemed as unconstitutional a controversial law that prohibited any township or municipality in the state from enacting gun-related ordinances that aren’t already part of state law.

Act 192, signed by former Gov. Tom Corbett in November, also allowed out-of-state groups like the National Rifle Association to sue any municipality for having such ordinances.

Mayor Nutter called the decision "a great victory for cities, for public safety and for good government." 

“Philadelphia is grateful to be allowed to pursue its common sense gun safety agenda -- including requiring persons who lose their guns or have their guns stolen to take the obviously sensible step of reporting the loss or theft to the police -- without interference from an advocacy organization like the NRA that does not speak for the citizens of Philadelphia or Pennsylvania,” he said.

The decision came down in response to a lawsuit filed by a group of lawmakers led by State Sen. Daylin Leach against the state. 

Prior to it being struck down, the NRA had filed lawsuits against Philadelphia, Pittsburgh and Lancaster over their local gun ordinances.