(Reuters) - A federal judge on Friday blocked the state of Indiana from enforcing a 2017 law allowing election officials to remove voters from the rolls if they were flagged by a controversial tracking system.

U.S. District Judge Tanya Walton Pratt ruled in a legal challenge brought by the American Civil Liberties Union on behalf of Common Cause Indiana and other groups that the legislation violates the National Voter Registration Act and threatens to disenfranchise eligible voters.

“The court agrees with Common Cause that the greater public interest is in allowing eligible voters to exercise their right to vote without being disenfranchised without notice,” Pratt wrote in her 28-page ruling.

“While the defendants have a strong public interest in protecting the integrity of voter registration rolls and the electoral process, they have other procedures in place that can protect that public interest that do not violate the NVRA,” Pratt wrote in granting a preliminary injunction.

That injunction bars the state from enforcing the law while the lawsuit is fought in court.

So-called Indiana Senate Enrolled Act 442, which was approved by lawmakers in 2017, amends the state’s voter registration laws to allow elections officials to remove from the rolls any voters found registered in another state by a system called Crosscheck that is administered by the Kansas Secretary of State.

“Hoosier-elected officials should do all that they can to promote voter engagement,” Jane Heneger, executive director of ACLU of Indiana, said in a written statement. “Today’s ruling condemns actions to the contrary that threaten to suppress the vote. Voting is our constitutional right and we must ensure every voice is heard.”

Representatives for Indiana Secretary of State Connie Lawson, named as the chief defendant in the lawsuit, could not be reached for comment on Friday evening.

The plaintiffs successfully argued that the legislation violated the National Voter Registration Act because that system relied on incomplete and sometimes flawed registration information, did not seek written confirmation from the voter before removing them and was not applied uniformly.

The defendants argued that registering to vote in another state should be considered written confirmation in itself and that the plaintiffs could not demonstrate that any voter had been wrongfully removed so far, arguments that Pratt rejected.