ALBANY, N.Y. (AP) — The Democrat-controlled New York state Legislature has passed legislation that requires gun owners to keep firearms in a locked cabinet or equipped with a trigger-locking device if someone under 16 is in the home.

The Assembly and Senate passed the legislation Monday, five weeks after lawmakers approved a package of other gun-control measures.

The latest measure, sponsored by Sen. Liz Krueger of Manhattan and Assemblywoman Amy Paulin of Westchester, makes it a misdemeanor offense to fail to securely store a rifle, shotgun or other firearm or render it incapable of being fired when a child is in a home.

Assembly and Senate Republicans who voted against the measure said it’s an infringement on Second Amendment rights to bear arms and could leave a gun owner defenseless against intruders.

“We’re ecstatic,” said Paul McQuillen of Hamburg  who represents the group New Yorkers Against Gun Violence. “It was our primary goal and has been for the past few years, so we’re really  excited that it’s finally passed the Legislature.”

He hopes it will prevent shootings involving children and teens, whether they be accidental, or suicides or school shootings. “The fact of the matter is, if a gun is in your kitchen, and you’re in the backyard, it’s unsecured and children have access to it.”

But the Shooters Committee on Political Education might fight this in court, citing a 2008 case where a law like this was argued to make it harder for gun owners to have a gun readily available to protect their homes.

Andrews says many gun owners already lock up their guns, but he feels it shouldn’t be mandated. “A lot of the firearm accidents involving minors usually involve circumstances where the homeowner of the person owning the firearm owned it illegally. A lot of cases, they were felons themselves and those are folks who aren’t going to pay attention to bills or laws like this.”

When and if Governor Andrew Cuomo signs the legislation, uit would apply to any household where kids under age 16 are living or visiting. The only exception would be if the child has already gone through a hunter safety course.

Gun owners who are in violation could face a misdemeanor charge punishable by up to a year in jail and a fine of $1,000.