A federal appeals court on Monday upheld strict statewide bans on assault weapons and large-capacity magazines that were passed in New York and Connecticut after the 2012 mass murders at Sandy Hook Elementary School.

In finding that the “core provisions” of the laws did not violate the Second Amendment, Judge José A. Cabranes, writing for a unanimous three-judge panel of the United States Court of Appeals for the Second Circuit in Manhattan, said the states had acted “based on substantial evidence” and had “tailored the legislation at issue to address these particularly hazardous weapons.”

He noted that state legislatures were “far better equipped than the judiciary to make sensitive public policy judgments (within constitutional limits) concerning the dangers in carrying firearms and the manner to combat those risks.”

Judge Cabranes noted that the legislation had been “targeted to prevent mass shootings like that in Newtown,” referring the school shooting in Connecticut in which the gunman, Adam Lanza, fired 154 rounds.