The National Rifle Association challenged a series of measures that were passed by City Council in April 2008 and signed by Mayor Michael Nutter. Both sides expect the case to end up before the state's highest court again.
"The bottom line is, we won," NRA attorney C. Scott Shields said of the ruling.
In Thursday's ruling, the court said the city could not ban assault weapons or pass the law prohibiting straw purchases, in which one person fills out forms and buys a gun for someone else - often convicted felons who can't legally own guns.
In a dissenting opinion, Commonwealth Judge Doris A. Smith-Ribner asserted the city does have the right to pass its own gun laws, citing the hundreds of residents killed by gun violence every year.
The NRA has also asked the U.S. Supreme Court to strike down strict gun control laws in the Chicago area. The NRA wants the court to rule that last year's decision invalidating a handgun ban in the District of Columbia also applies to local and state laws. The justices likely won't decide before late September whether to hear the NRA's case.
That appeal came after a federal appeals court in Chicago said this month that it is bound by earlier Supreme Court decisions that held the Second Amendment applies only to federal laws. Supreme Court nominee Sonia Sotomayor was part of an appeals court panel in New York that reached a similar conclusion in January.
Judges on both courts - Republican nominees in Chicago and Democratic nominees in New York - said only the Supreme Court could decide whether to extend last year's ruling throughout the country. Many, but not all, of the constitutional protections in the Bill of Rights have been applied to cities and states.
The framers of the Constitution intended "to protect the right to keep and bear arms and other rights from state infringement," the NRA said in a filing to the Supreme Court.
In Pennsylvania, the state appeals court also ruled Thursday that the NRA lacked standing in challenges to three other measures, saying the plaintiffs failed to show that they suffered "injury."
Those three laws require gun owners to report lost or stolen guns within 48 hours; allow police to confiscate guns from people who are considered a danger; and prohibit anyone subject to a protection-from-abuse order from possessing a gun. Only the lost-or-stolen gun ordinance is currently being enforced.
A 1974 state law says that only the General Assembly can regulate guns, but the Philadelphia case is being watched by other cities in the state, including several that have passed measures requiring gun owners to report lost or stolen guns.