A divided federal appeals court said Tuesday that a District of Columbia law restricting the right to carry a concealed firearm in public was a violation of the Second Amendment.

D.C. requires gun owners who want a concealed-carry permit to show a “good reason to fear injury or a “proper reason” such as transporting valuables.

The U.S. Court of Appeals for the D.C. Circuit declared the regulation too restrictive in a 2-1 decision, The Washington Post reported.

“The good-reason law is necessarily a total ban on most D.C. residents’ right to carry a gun in the face of ordinary self-defense needs, where these residents are no more dangerous with a gun than the next law-abiding citizen,” Judge Thomas B. Griffith wrote.

“At the Second Amendment’s core lies the right of responsible citizens to carry firearms for personal self-defense beyond the home, subject to longstanding restrictions,” the judge said. “These traditional limits include, for instance, licensing requirements, but not bans on carrying in urban areas like D.C. or bans on carrying absent a special need for self-defense.

“In fact, the Amendment’s core at a minimum shields the typically situated citizen’s ability to carry common arms generally. The District’s good-reason law is necessarily a total ban on exercises of that constitutional right for most D.C. residents.”

Judge Stephen F. Williams joined Griffith in the decision.

The decision deals another legal blow to efforts by city officials to rewrite gun regulations since the Supreme Court declared a Second Amendment right to gun ownership in a 2008 D.C. gun case, The Post reported.

Griffith said the Supreme Court’s decision in that case made it clear that “the Second Amendment erects some absolute barriers that no gun law may breach.”

John R. Lott, Jr. of the Crime Prevention Research Center called the decision huge victory for gun rights advocates.

“Right now, there are about 124 concealed handgun permit holders in D.C.,” Lott told Fox News. “If D.C. were like the 42 right-to-carry states, they would have about 48,000 permits. Right now D.C. prevents the most vulnerable people, particularly poor blacks who live in high crime areas of D.C., from having any hope of getting a permit for protection.”

The lone dissenter, Judge Karen Henderson, said the district’s regulation passed constitutional muster.

“The District identifies two important government objectives underlying its licensing regime: the prevention of crime and the promotion of public safety,” Henderson said.

Two lower court judges disagreed on whether the regulation infringed Second Amendment rights.

Gun rights groups and Republican attorneys general from more than a dozen states told the court that the District’s system was unconstitutional because the typical law-abiding citizen could not obtain a permit, The Post reported.

City officials could ask all the judges on the circuit to rule on the matter, if they elect to appeal the decision.