A Philadelphia judge today sided with the National Rifle Association and struck down city ordinances banning assault weapons and limiting handgun purchases to one a month.

In a blow to the city's attempt to write its own gun laws, Common Pleas Court Judge Jane Cutler-Greenspan ruled that Philadelphia should be permanently prevented from enforcing the laws that the City Council passed unanimously in April.

But Greenspan gave city officials a consolation prize by declining to strike down three other laws on procedural grounds, indicating that the NRA and other plaintiffs did not have legal standing to challenge those laws.

Lawyers on both sides of the emotional issue hailed the split decision in a positive light.

"It's a partial victory," said Douglas I. Oliver, Mayor Nutter's spokesman. He said that the judge's decision to let three laws stand "shows that this city's actions were legal and not actions of a renegade government."

NRA lawyer C. Scott Shields called Cutler-Greenspan's ruling a "huge victory" for gun-rights advocates.

"The assault-weapons ban was just ridiculous," he said. "There's just no way this would be enforceable."

The adversaries agreed on only one thing: That the decision would be appealed, likely all the way to the state Supreme Court.

The lawyers said they were awaiting Greenspan's opinion spelling out her decision.

During hearings, Greenspan indicated that she agreed with the NRA's position that superceding state laws prevent the city from regulating guns in any way.

Yet by allowing three laws to stand, Greenspan gave gun-control advocates some hope that municipalities facing high levels of violent crime could push for local control.

The three laws Greenspan allowed to stand allow judges to remove guns from people declared to be a risk to themselves or others, prevent people subject to protection-from-abuse orders from owning guns, and require gun owners to report the loss or theft of a gun to police within 24 hours.

Oliver said the city would immediately begin to enforce the law requiring gun owners to report lost guns. He said the other two laws would require enforcement regulations.

Shields said it was only a matter of time, as the city attempted to enforce the laws, that the NRA would locate aggrieved parties who could act as plaintiffs.

"For judicial economy, the judge should declare all of the laws unenforceable now," he said.

Joe Grace, executive director of CeaseFire PA, called the ruling a "significant step forward" and urged other municipalities to enact local gun control laws.

Mayor Nutter and City Council staked their positions in April by drafting the five new laws.

The NRA, two city gun shops, and others obtained a temporary restraining order a week after Nutter signed the laws.

During the hearings, Greenspan issued an order that excluded most of the evidence the city hoped to present. She cited the 1996 Supreme Court ruling establishing the state's preeminence in regulating firearms.

City lawyers tried to get some witness testimony into the record so that higher courts would have evidence to consider on appeal. That record may also be as critical to the public relations campaign as to the court case, as city leaders try to reverse a string of losses in the courts and the legislature.

Contact staff writer Andrew Maykuth at 215-854-2947 or amaykuth@phillynews.com.

Inquirer staff writer Jeff Shields contributed to this report.