(Reuters) - A New Hampshire judge on Monday put on hold a law requiring some voters to present proof of residency when they register, saying it would lengthen lines at polling places and make it difficult for students, disabled voters and others to cast ballots.

FILE PHOTO: Millennial voters in Rochester, New Hampshire, U.S., March 27, 2018. REUTERS/Brian Snyder

The temporary injunction against the Republican-backed law comes two weeks before U.S. Congressional elections that will determine whether opposition Democrats or U.S. President Donald Trump’s Republicans retain full control of the federal government’s legislative branch.

The measure, which passed largely along party lines and went into effect last year, required those seeking to register within 30 days of an election to present documents proving that they live in the area where they intend to vote. Without such proof, they must agree to either send it in within 10 days or the state will seek to verify their domicile.

The law does not require proof of address when voting.

“Where the law threatens to disenfranchise an individual’s right to vote, the only viable remedy is to enjoin its enforcement,” Presiding Justice Kenneth C. Brown wrote in his decision for the Hillsborough Superior Court Northern District in Manchester.

He added that the registration form is too complicated for many people to understand.

The legislation is the subject of a lawsuit filed by League of Women Voters of New Hampshire and other groups, who said it would disenfranchise numerous groups including students, the disabled and homeless voters. The measure will be put on hold while the merits of the case are decided.

New Hampshire Congresswoman Carol Shea-Porter, a Democrat, welcomed the ruling.

“This law undermines our state’s reputation for holding free and fair elections, and it hurts our democracy,” she said in a statement.

New Hampshire Associate Attorney General Anne Edwards said through a spokeswoman on Monday that the state was reviewing the court order and would soon communicate its next steps. She did not say whether that would include appealing the injunction.