An appeals court ruling has struck down a challenge to New York's red flag law.

The law, which was put in place in 2019, is an extreme risk protection order that prohibits a person from purchasing or possessing a firearm, rifle or shotgun if it's believed they are a threat to themselves or others.

Changes were made and the law was strengthened after a gunman opened fire in a Buffalo Tops store in May 2022, killing 10 Black people.

The constitutionality of the red flag law was recently challenged, but the court found it to be in line with state law. The challenge came from a case that did not have to do with the Buffalo mass shooting or how the Buffalo shooter obtained his weapons.

Many argue the law could have prevented the Buffalo shooter from legally buying the guns he used in the attack; however, no petition was ever filed to prevent him from buying or possessing firearms.

“It’s a temporary surrender of constitutional rights, but I believe in this example, that it’s for the safety of the people," said Sheldon Boyce, attorney and partner, Brenna Boyce PLLC. "And again, even though I’m a staunch defender of the Second Amendment, I have no problem with extreme risk protective orders.”

Gov. Kathy Hochul responded to the appeals court decision, saying these are common sense laws that will protect public safety.