A New Jersey appeals court has upheld against a Second Amendment challenge the state’s “justifiable need” requirement for obtaining a permit to carry a handgun outside the home.

“The Legislature has determined that the presence of readily accessible handguns in public places of this densely populated State presents an inherent risk of serious injury from accident and misuse,” the judges held Monday in a published opinion. “The risk of accident and misuse in public places of this State where a carry permit is required is enhanced—if for no other reason than a handgun poses a greater danger in public than it would if left at home.”

In a consolidated ruling, the court affirmed the denial of gun permits to Jonathan Wheeler and George Daudelin, both of whom retired in good standing from the Newark Fire Department’s Arson Investigations Unit.

New Jersey gun laws permit retired police officers to carry handguns outside the home, but Wheeler and Daudelin did not qualify, even if they carried weapons on duty.

They had to show “an urgent necessity…for self-protection” based on “specific threats or previous attacks demonstrating a special danger to the applicant’s life that cannot be avoided by other means.”

Essex County Superior Court Judge Joseph Cassini III denied their applications, and on Monday, Appellate Division Judges Jane Grall, Allison Accurso and Ellen Koblitz affirmed.

Grall, writing for the court, said the justifiable-need standard has been around in some form since 1924 and has withstood constitutional scrutiny. Other states, such as Hawaii, Maryland, Massachusetts, New York and Rhode Island, have similar laws.

“It is an effort to protect the public and accommodate those who have an objective reason to anticipate a need to use a gun in self-defense,” Grall said. “The law targets the dangers of misuse and accidental use of handguns that unquestionably have serious, injurious consequences wholly outside the purview of self-defense.”

Grall said the U.S. Supreme Court rulings on which the applicants based their challenge—District of Columbia v. Heller, 554 U.S. 570 (2008), and McDonald v. Chicago, 130 S.Ct. 3020 (2010)—declared unconstitutional laws that effectively barred people from keeping handguns in their homes.

Although those rulings could be read to mean that the right to carry a handgun extends outside the home, “We cannot conclude that the Amendment or the Court’s recent decisions require this State to dismantle its statutory scheme addressing the risks of misuse and accidental use in public places devised long ago and developed over many years.”

The applicants’ attorney, J. Sheldon Cohen, of DeCotiis, FitzPatrick & Cole in Teaneck, says he has not had a chance to discuss the ruling with his clients.

Jef Henninger, who represents gun permit applicants but not in these cases, says the judges “really dropped the ball. It’s to be expected. But being able to demonstrate a justifiable need in this state is virtually impossible.

“It might not be a complete ban, but it’s just as elusive,” says Henninger, who runs a firm in Tinton Falls. “They’ve made it impossible to get a carry permit. It’s basically a joke.”

Nicola Bocour, director of Ceasefire New Jersey, says she is “glad to see yet another court saying the justifiable need requirement is permissible. There continue to be these appeals, and courts are consistently saying these restrictions are permissible.”

Assistant Essex County Prosecutor Maria Guerrero defended the law on appeal. Katherine Carter, a spokeswoman for her office, issued a statement saying, “We recognize the importance of the statutes implicated and we will follow the courts guidance.”

The Attorney General’s Office, which normally defends state statutes in constitutional challenges, participated in the Law Division but not in the appeal. Officials from that office did not respond to requests for comment.

Gov. Chris Christie is expected to run for the Republican nomination for president in 2016. He already is considered too liberal by some conservative groups, and defending a gun-control law could risk alienating himself from gun-rights advocacy groups.