TRENTON -- New Jersey is closer to settling a lawsuit that would end the state's ban on civilians buying stun guns.

In court papers filed Tuesday, Attorney General Christopher Porrino conceded the state's ban on electronic arms is unconstitutional. The state law defines a stun gun as "any weapon or other device which emits an electrical charge or current intended to temporarily or permanently disable a person."

Regulations permit police officers in New Jersey to use stun guns.

Resident Mark Cheeseman and the New Jersey Second Amendment Society filed suit in August 2016 after Taser International declined his order for a Taser Pulse model because the state bans the sale of such merchandise. Cheeseman said he wanted a nonlethal way to protect himself and his family.

New Jersey is one of five states -- Hawaii, Massachusetts, New York and Rhode Island are the others -- that prohibits civilians from buying stun guns. Other cities and counties also have bans.

Under the proposed consent decree, the state acknowledged the Second Amendment guarantees a fundamental right to keep and bear arms for self-defense. However, the state would be permitted to impose "reasonable limits" on stun guns.

Porrino wrote "that an outright ban on the possession of stun guns within the state, regardless of the contextual circumstances surrounding any such possession, would likely not pass constitutional muster."

Porrino cited a U.S. Supreme Court 2016 ruling that overturned a Massachusetts court that had upheld that state's ban in the case of a homeless woman, Jaime Caetano, who used a stun gun to scare away a former boyfriend.

Justice Samuel Alito Jr. wrote in a concurrence that, "by arming herself, Caetano was able to protect against a physical threat that restraining orders had proved useless to prevent. And, commendably, she did so by using a weapon that posed little, if any, danger of permanently harming either herself or the father of her children."

A federal judge must approve the consent decree, which would give the state 180 days to craft regulations "consistent with public safety and the Second Amendment" governing the possession of stun guns.

While supporters say stun guns are a nonlethal form of protection, there have been dozens of lawsuits filed against police departments after suspects zapped with stun guns have died.