A federal district court on Thursday upheld a Connecticut gun control law that expanded the state’s assault weapons ban, created a dangerous weapon offender registry and formed new rules for buying ammunition, the Hartford Courant reported.

“The court concludes that the legislation is constitutional,” Judge Alfred Covello wrote in the decision. “While the act burdens the plaintiffs’ Second Amendment rights, it is substantially related to the important governmental interest of public safety and crime control.”

The law was passed and signed by Gov. Dannel Malloy last year in the wake of the shooting at Sandy Hook Elementary School, and went into effect at the beginning of 2014.

A group of gun owners challenged the law, claiming that it violated the Second Amendment. Covello, a Republican appointee, rebutted their claims and said that the law was meant to provide for public safety.

“Obviously, the court cannot foretell how successful the legislation will be in preventing crime,” he wrote. “Nevertheless, for the purposes of the court’s inquiry here, Connecticut, in passing the legislation, has drawn reasonable inferences from substantial evidence.”