A federal judge has tossed out the Democratic National Committee’s suit against Russia, Trump campaign officials and Wikileaks regarding a massive email hack in the runup to the 2016 presidential election that the Dems said was part of a joint operation to put Donald Trump in power.

In an 81-page ruling issued on Tuesday, Manhattan federal Judge John Koetl called the Russian Federation the “primary wrongdoer” in the massive hack for “surreptitiously and illegally” breaking into the DNC’s computers and disseminating the pilfered emails.

But Koeltl said that under the Foreign Sovereign Immunities Act, Russia cannot be targeted in a civil suit.

As for Trump campaign officials, Wikileaks and Wikileaks founder Julian Assange, Koeltl said those parties are protected by the First Amendment — the same way that news organizations are able to publish materials of public interest so long as they do not participate in any wrongdoing to obtain the materials.

Koeltl issued his ruling less than two weeks after holding a hearing with the parties in the DNC’s suit in which he signaled that he may consider the conclusions from Special Counsel Robert Mueller’s report on Russian interference into the 2016 elections when deciding whether to dismiss the suit.

He also denied a motion by the defendants in the case to impose sanctions on the DNC.