New York Attorney General Letitia James near the scene of a shooting at a supermarket in Buffalo, New York.
CNN  — 

A federal judge Wednesday dismissed a lawsuit from gun industry groups challenging a New York law that permits civil lawsuits against companies for conduct found to have endangered public safety.

US District Judge Mae D’Agostino – a Barack Obama appointee for the Northern District of New York – rejected the arguments that the challengers had made that the state law violated the US Constitution.

The judge concluded that the New York law did not preempt a 2005 federal law limiting the liability gun manufacturers and dealers can face. Citing an appellate court opinion in a separate case, D’Agostino said the New York law fit within an exception laid out in the federal statute.

The judge also dismissed the claims that the New York law violated the Commerce Clause for discriminating against in-state competitors, as well as the challengers’ arguments that the law was unconstitutionally regulating conduct happening outside of the state. She additionally rejected arguments that the law was written in an impermissibly vague way.

An executive for a firearms trade association that was challenging the New York law said that the group was “disappointed” by the ruling.

“We respectfully disagree with the court’s decision and plan to appeal this decision,” Lawrence G. Keane, National Shooting Sports Foundation senior vice president and general counsel, said in a statement.

New York Attorney General Letitia James, who was defending the law in court, issued a statement celebrating the ruling while noting the mass shootings at a Texas elementary school and a grocery store in Buffalo, New York.

“As we mourn the deaths of 19 innocent children lost to gun violence in Uvalde and the countless more in Buffalo and across America every day, this is a moment of light and hope,” James said. “New York is proud to defend the right to impose reasonable gun restrictions that protect all of us. As public officials, we were elected to solve problems and address the needs of the people.”