US District Judge Sparkle Sooknanan's 78-page ruling sided with the watchdog group Common Cause. She found that the administration had understated the risk of wrongly removing eligible citizens from voter rolls because of inaccuracies in the Systematic Alien Verification for Entitlements (SAVE) database, which can contain outdated citizenship records and may misidentify naturalised US citizens.
"The challenged policy represents the federal government's attempt to decide who gets to vote," Sooknanan wrote, noting that Congress had left that authority to the states.
The Justice Department said it was reviewing the ruling.
Ming Cheung, a senior staff attorney with the American Civil Liberties Union's Voting Rights Project, said the ruling made clear that the administration could not use the federal government to disrupt elections or put voters' rights at risk.
"The Trump administration has repeatedly taken extreme measures to interfere with how elections are run, undermine confidence in the results, and create confusion," Cheung said in a statement.
Last year, Trump directed the department to crack down on voting by ineligible people, despite research showing voter fraud is rare. The department subsequently demanded unredacted voter rolls from nearly all 50 states, including sensitive personal information. Eighteen states, mostly Republican-led, complied. The department cross-checked their data against SAVE and flagged people identified as noncitizens for potential removal from voter rolls.
The department has also sued 30 states and Washington, DC, over their refusal to provide voter data. Twenty-six of those cases have been dismissed.
In a separate case in June, Sooknanan blocked the expanded use of the SAVE database for voter roll checks, an order the US Supreme Court temporarily paused last month. Federal law bars systematic voter roll purges in the 90 days before a federal election, which could limit the ruling's practical effect before the November 3 vote.