A federal judge has ruled that a state law barring legal immigrants from possessing handguns and large-capacity weapons is unconstitutional.

A federal judge has ruled that a state law barring legal immigrants from possessing handguns and large-capacity weapons is unconstitutional.

Issued Friday, the ruling came in response to a lawsuit Northborough resident Eoin Pryal filed with a Cambridge man last April against Northborough Police Chief Mark Leahy, Cambridge Police Chief Robert Haas and state Firearms Records Bureau Director Jason Guida.

“This case presents the question of whether lawful permanent resident aliens are among ‘the people’ for whom the Second Amendment the United States Constitution provides a right to bear arms,” U.S. District Judge Douglas P. Woodlock wrote in his decision. “I conclude they are.”

Under state law, legal immigrants can possess rifles and shotguns but not handguns or large-capacity weapons.

Pryal and Cambridge resident Christopher M. Fletcher, both legal immigrants from Great Britain, argued that the law had prevented them from their right to protect their households and violates the Second Amendment as well as the equal protection clause of the 14th Amendment.

Pryal claimed he submitted an application to Northborough Police, was referred to the state and denied a license. Chief Leahy has steadfastly denied he ever received an application and said last April he was “at a loss” for why his name was included since immigrants are required by law to go through the state for gun licenses.

Leahy referred comment to town counsel Kay Doyle at Kopelman & Paige, PC. Doyle couldn’t be immediately reached late last night.

In his decision, Woodlock wrote that the state’s “firearm regulatory regime, as applied to Fletcher and Pryal, does not pass constitutional muster” on several different levels of legal scrutiny.

According to Woodlock’s decision, the state defended its regulations by pointing to its “compelling interest in limiting the proliferation of firearms because of their inherent danger.”

Woodlock said the statute “fails to distinguish between dangerous non-citizens and those non-citizens who would pose no particular threat.

“Any classification based on the assumption that lawful permanent residents are categorically dangerous and that all American citizens by contrast are trustworthy lacks even a reasonable basis,” he wrote.

The ruling doesn’t apply to all legal immigrants, Woodlock said, only to legal immigrants who have been granted permanent residency.

That’s because he decided that two organizations that joined in the suit on behalf of other legal immigrants — Natick-based Commonwealth Second Amendment Inc. and Second Amendment Foundation Inc. of Bellevue, Wash. — didn’t have standing.

Nevertheless, Commonwealth Second Amendment President Brent Carlton said his group is thrilled.

“This represents probably the first time the federal court has struck down a Massachusetts gun law,” he said “We’re hoping it won’t be the last.”

Joseph M. Hickson III, who represented all four parties, said the state can still appeal the ruling or pursue several other avenues.

“There’s a plethora of options at this point,” he said.

Terrel Harris, spokesman for the Executive Office of Public Safety and Security, said he could only say that his office has received the decision and is still reviewing it.

(Brad Petrishen can be reached at 508-490-7463 or bpetrishen@wickedlocal.com. For Northborough news throughout the day, follow him at twitter.com/Brad_Petrishen.)