Attorneys general from 26 states filed a federal lawsuit against San Francisco on Thursday over an ordinance requiring locked storage for handguns, arguing it threatens the Second Amendment right to bear arms.

San Francisco firearms must either be stored in a locked container or with a trigger lock at all times in a home unless the owner is carrying the firearm, according to the lawsuit. The suit notes the ordinance applies even if someone is the sole occupant of their home or sleeping, which is dangerous for gun owners, the states say.

“Common sense dictates that in high stress, emergency situations, the ease and speed with which a person can utilize one of these mechanisms to unlock a safe drastically decreases,” the suit reads. “It is common to fumble with keys while trying to hurriedly unlock a door, to forget a series of numbers when under pressure, or to struggle with hand-eye coordination when subjected to stressors.”

Wisconsin Attorney General Brad Schimel said in a statement the ordinance could set a precedent that “could influence policy decisions and court holdings” nationwide, which is why so many states signed on.

The suit was submitted by Nebraska Attorney General Jon Bruning and included the attorneys general from the states of Alabama, Alaska, Arizona, Arkansas, Florida, Georgia, Idaho, Indiana, Kansas, Kentucky, Louisiana, Michigan, Minnesota, Missouri, Montana, Nebraska, Nevada, North Dakota, Oklahoma, South Carolina, South Dakota, Texas, Utah, West Virginia, Wisconsin and Wyoming.