A Massachusetts judge has ruled that the state's requirement that eligible voters register at least 20 days before an election is unconstitutional.

Suffolk Superior Court Judge Douglas Wilkins on Monday found the 20-day cutoff disenfranchises thousands of potential voters.

In his ruling, Wilkins pointed to the state's adoption of early voting last year to argue against the 20-day cutoff.

That change allowed voters to begin casting ballots on Oct. 24, just five days after the Oct. 19 registration cutoff.

Democratic Secretary of State William Galvin said the decision will spark "administrative chaos." He said his office will appeal the ruling, but also said he's willing to find a compromise.

"We're open to discussion about the most streamlined administrative process we can have," Galvin told WBUR. "Any change beyond that, such as same-day [voter registration] ... would require legislative approval."

Galvin says the state's 20-day cutoff is one of the shortest in the country.

In his decision, Judge Wilkins said lawmakers may pass laws deemed necessary to ensure the qualifications of voters, but the evidence "overwhelmingly shows no such necessity for the Massachusetts registration cutoff."

With reporting by the Associated Press and the WBUR Newsroom