A federal judge dismissed Democrats’ lawsuit against Russia, WikiLeaks, and the Trump campaign on Tuesday, saying that Russia was the main culprit and could not be sued under federal law. The Democratic National Committee filed the lawsuit last year, claiming that those three parties, and others related to them, had violated hacking and racketeering laws in connection with the 2016 breach of the DNC’s computer systems and the subsequent release of the organization’s private emails.

WikiLeaks’ publication of DNC emails was protected by the First Amendment

Russia cannot be sued because of the Foreign Sovereign Immunities Act, which largely prevents lawsuits against foreign governments, wrote Judge John Koeltl, a Clinton appointee in the Southern District of New York. “The remedies for hostile actions by foreign governments are state actions,” Koeltl wrote.

At the same time, WikiLeaks and the Trump campaign can’t be held liable for the dissemination of stolen materials because of First Amendment protections, the judge ruled. Referencing the Supreme Court case that upheld the publishing of the Pentagon Papers, the judge wrote that “the First Amendment prevents such liability in the same way it would preclude liability for press outlets” that published illegally obtained materials.

While the DNC also alleged that WikiLeaks and other parties played a role in the hacking of its email accounts, Koeltl wrote that the organization “failed to allege plausibly” that anyone else was a participant, leading those claims to be dismissed. The DNC didn’t immediately respond to a request for comment.

The Trump campaign seized on the ruling as a win for the President against allegations of collusion, calling it “a huge victory in court” in a statement.