CONCORD, N.H. —A New Hampshire judge has struck down a 2012 law as unconstitutional that effectively blocked out-of-state students and others from voting in New Hampshire unless they established residency in the state that extended to other activities beyond voting, such as getting a driver’s license.

The New Hampshire Civil Liberties Union filed a petition on behalf of four out-of-state college students and the New Hampshire League of Women Voters two years ago, arguing the law would freeze out eligible voters. The law required people registering to vote to sign a statement saying they declare New Hampshire their domicile and are subject to laws that apply to all residents, including requirements they register their cars in the state and get a New Hampshire driver’s license. Gov. John Lynch vetoed the legislation, but lawmakers overrode his veto.

In making a preliminary order permanent, Strafford County Superior Court Judge Brian Tucker said the law added language to voter registration forms that was a “confusing and unreasonable description of (existing) law” and was “unduly restrictive.”

Tucker cited a 2006 New Hampshire Supreme Court ruling that listing candidates in alphabetical order, giving preferential placement to the parties based on the votes they garnered in the last election, is unconstitutional.

He said the language added to the registration forms may discourage people from voting if they think they have to change their driver’s license and car registration, resulting in “a severe chilling effect on the right of those domiciled here to vote.”

“The threat to the fundamental right to vote here is at least as acute as the danger that alphabetical listing of candidates had on the right to be elected,” Tucker wrote.

The Civil Liberties Union received notice Friday that the judge made permanent a previous preliminary order blocking enforcement of the law.

“By protecting voting as a fundamental right, today’s decision affirms that all New Hampshire voters who call this state ‘home’ should have the opportunity to participate equally in the democratic process,” Gilles Bissonnette, a lawyer for the group, said.

Bissonnette said the law, if enforced, would have applied to not just students, but to resident doctors in training and members of the military who plan to leave the state when their work is done.

“If (legal) residency was the requirement to vote, it would disenfranchise all sorts of people in New Hampshire,” Bissonnette said.

Secretary of State Bill Gardner and the attorney general’s office did not immediately return calls seeking comment.

Send questions/comments to the editors.