Maryland residents do not have to provide a "good and substantial reason" to legally own a handgun, a federal judge ruled Monday, striking down as unconstitutional the state's requirements for getting a permit.

U.S. District Judge Benson Everett Legg wrote that states are allowed some leeway in deciding the way residents exercise their Second Amendment right to bear arms, but Maryland's objective was to limit the number of firearms that individuals could carry, effectively creating a rationing system that rewarded those who provided the right answer for wanting to own a gun.

"A citizen may not be required to offer a 'good and substantial reason' why he should be permitted to exercise his rights," Legg wrote. "The right's existence is all the reason he needs."

But state Assistant Attorney General Matthew Fader vowed to appeal the ruling.

“We disagree with this ruling," Fader said in a written statement that noted the "very important implications of the ruling for public safety."

Plaintiff Raymond Woollard obtained a handgun permit after fighting with an intruder in his Hampstead home in 2002, but was denied a renewal in 2009 because he could not show he had been subject to "threats occurring beyond his residence."

Woollard appealed, but his appeal was rejected by the review board, which found he hadn't demonstrated a "good and substantial reason" to carry a handgun as a reasonable precaution. The suit filed in 2010 claimed that Maryland didn't have a reason to deny the renewal and wrongly put the burden on Woollard to show why he still needed to carry a gun.

"People have the right to carry a gun for self-defense and don't have to prove that there's a special reason for them to seek the permit," said his attorney Alan Gura, who has challenged handgun bans in the District of Columbia and Chicago as an attorney with the Second Amendment Foundation. "We're not against the idea of a permit process, but the licensing system has to acknowledge that there's a right to bear arms."

In his ruling, Legg wrote that Second Amendment protections aren't limited to the household.

"In addition to self-defense, the (Second Amendment) right was also understood to allow for militia membership and hunting. To secure these rights, the Second Amendment's protections must extend beyond the home: neither hunting nor militia training is a household activity, and 'self-defense has to take place wherever (a) person happens to be,'" Legg wrote.

"Judge Legg's ruling takes a substantial step toward restoring the Second Amendment to its rightful place in the Bill of Rights and provides gun owners with another significant victory," said SAF founder and Executive Vice President Alan M. Gottlieb. "The federal district court has carefully spelled out the obvious, that the Second Amendment does not stop at one's doorstep, but protects us wherever we have a right to be."

The lawsuit names the state police superintendent and members of the Handgun Permit Review Board as defendants.

Many states require gun permits, but six states, including Maryland, issue permits on a discretionary basis, Gura said. In most of those states, these challenges have not succeeded in U.S. District Courts, but they are being appealed, he said.

"Most states that choose to regulate the right to bear arms have licensing systems that are objective and straightforward," Gura said. "That's all that we want for Maryland."

The Associated Press contributed to this report.