U.S. District Judge Sparkle Sooknanan wrote that the government had knowingly fed flawed information to states, which are now “actively” and “haphazardly” removing purported non-citizens from voter rolls.

The ruling strikes at the heart of President Donald Trump’s broader push to reshape American elections, a campaign that has repeatedly run into judicial roadblocks. Sooknanan, an appointee of President Joe Biden, found that the updated system operated by the Department of Homeland Security combined citizenship data with records from the Social Security Administration in a manner Congress had expressly prohibited. “The federal government has knowingly trampled on the privacy rights of American citizens in a manner that threatens the sacred right to vote,” she wrote. “This Court cannot stand idly by while that happens.”

The lawsuit, brought by the League of Women Voters and other advocacy groups, challenged the revised version of the so-called SAVE database. Sooknanan determined that despite deep and acknowledged concerns about the accuracy of the underlying records, the administration had shared the database with states. “Since then, states have run their voter rolls through the modified SAVE system, and some of the Plaintiffs’ members have been wrongfully identified as non-citizens by SAVE, resulting in the cancellation of their voter registrations,” she wrote.

The decision halts a key pillar of Trump’s efforts to overhaul election administration without congressional approval. Other initiatives, including attempts to coerce states into adopting new voter identification rules and to restrict mail-in balloting, have also been blocked or tied up in court. The ruling effectively freezes the database project until the legal challenge is resolved.

Neither the Department of Homeland Security nor the Treasury Department immediately responded to requests for comment on the ruling. The order takes effect immediately, barring the administration from further implementation of the revised SAVE system while the case proceeds.