NEW YORK (AP) — Gun control laws passed in New York and Connecticut to ban possession of semi-automatic weapons and large-capacity magazines after the 2012 massacre at Sandy Hook Elementary School were mostly upheld Monday by a federal appeals court.

The 2nd U.S. Circuit Court of Appeals in Manhattan found core parts of the laws did not violate the Second Amendment because there was a substantial relationship between bans on assault weapons and large-capacity magazines and the "important — indeed, compelling — state interest in controlling crime."

"When used, these weapons tend to result in more numerous wounds, more serious wounds, and more victims. These weapons are disproportionately used in crime, and particularly in criminal mass shootings," according to the ruling written by Circuit Judge Jose A. Cabranes.

"They are also disproportionately used to kill law enforcement officers."

The three-judge panel noted that the Newtown, Connecticut, shooting in December 2012 occurred when 154 rounds were fired in less than five minutes, killing 20 first-graders and six educators and renewing a nationwide discussion on the role of guns in America and how to diminish the threat of large-scale shootings.

But the court found Connecticut's ban on a non-semi-automatic Remington 7615 unconstitutional. And it said a seven-round load limit in New York could not be imposed even as it upheld other bans on magazines.

"Like assault weapons, large-capacity magazines result in 'more shots fired, persons wounded, and wounds per victim than do other gun attacks,'" the court said.

New York Attorney General Eric Schneiderman said he was pleased by the ruling. Connecticut Attorney General George Jepsen called the court's decision "deeply gratifying."

"At a time when many Americans have abandoned hope of government's ability to address gun violence in our schools and on our streets, Connecticut's laws — and today's decision — demonstrate that willing states can enact meaningful reform to improve public safety without violating the Second Amendment," he said in a statement.

"Now that the Court has ruled, it is time for everyone involved in the critical debate about how to keep weapons out of the hands of dangerous and unstable people to come together to work toward sensible solutions that will keep our communities safe."

Jake Palmateer, a spokesman for the gun rights group NY2A Grassroots Coalition, which wasn't a plaintiff, said he was disappointed.

"Just as no American citizen should face felony prosecution in one state for what is seen as free speech in another state, no American citizen should be denied their Second Amendment rights just because they live in New York or Connecticut," he said.

The appeals court addressed several gun rights groups' arguments, including that mass shootings are rare events that would be minimally affected by gun control laws.

"That may be so," the 2nd Circuit said. "But gun-control legislation 'need not strike at all evils at the same time' to be constitutional."

The appeals court said the claim by gun rights groups that the ban on assault weapons will primarily disarm law-abiding citizens was "speculative at best, and certainly not strong enough to overcome the substantial deference we owe to predictive judgments of the legislature on matters of public safety."