CHICAGO (AP) — A federal judge has potentially opened a new market to gun dealers after ruling as unconstitutional Chicago ordinances that aim to reduce gun violence by banning their sale within the city’s limits.

U.S. District Judge Edmond E. Chang said Monday that while the government has a duty to protect its citizens, it’s also obligated to protect constitutional rights, including the right to keep and bear arms for self-defense. However, Chang said he would temporarily stay the effects of his ruling, meaning the ordinances can stand while the city decides whether to appeal.

The decision is just the latest to attack what were some of the toughest gun-control laws in the nation. In 2010, the U.S. Supreme Court struck down Chicago’s long-standing gun ban. And last year, Illinois legislators were forced by a federal appeals court to adopt a law allowing residents to carry concealed weapons; it was the only state that still banned the practice. The resulting law largely stripped officials in the city and surrounding Cook County of their authority to regulate guns, which especially irked officials in Chicago, where residents had to apply for concealed-carry permits through the police superintendent.

National Rifle Association lobbyist Todd Vandermyde applauded Chang’s decision, saying it “shows how out of step and outrageous Chicago’s ordinances really are.”

Roderick Drew, a spokesman for Chicago’s law department, said Mayor Rahm Emanuel disagrees with Chang’s ruling and has instructed the city’s lawyer to consider options to regulate gun sales.

“Every year Chicago police recover more illegal guns than officers in any city in the country, a factor of lax federal laws as well as lax laws in Illinois and surrounding states related to straw purchasing and the transfer of guns,” Drew said. “We need stronger gun safety laws, not increased access to firearms within the city.”

Chang’s ruling came in a lawsuit filed by the Illinois Association of Firearms Retailers and three Chicago residents. The judge noted Chicago’s ban covers not only federally licensed firearms dealers, but also gifts among family members, all in the name of reducing gun violence.

In his 35-page opinion, Chang said he understood Chicago enacted the gun sale ban to safeguard its residents.

“That is one of the fundamental duties of government: to protect its citizens,” he wrote. “But on the other side of this case is another feature of government: certain fundamental rights are protected by the Constitution, put outside government’s reach, including the right to keep and bear arms for self-defense under the Second Amendment.”

Chicago last year had more homicides than any city in the nation. City officials have long acknowledged the ban on gun sales has been weakened due to the legal sale of guns in some surrounding suburbs and states.

Chicago gun collector Kenneth Pacholski, one of the plaintiffs, said he has no interest in selling guns and buys only antique guns that he intends to keep. But he said Chicago’s ban was unreasonable.

“All the people I know who own guns legally are really careful,” said Pacholski, whose wife, also was a plaintiff. “I’m a collector; my guns are not going anywhere unless I know where they’re going because I don’t want to be responsible for someone’s death.”

Illinois Council Against Hand Gun Violence campaign coordinator Mark Walsh said he wasn’t surprised by the ruling.

“I’m not sure what the city’s plan is (following the ruling), but I think obviously there is a need to make sure gun dealers coming into the city are aware of those who have restrictions on gun ownership and don’t sell to them,” he said.

Chicago still has a ban on assault weapons.

(TM and © Copyright 2014 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)