President Trump is declaring victory after a federal judge in New York dismissed a lawsuit the Democratic National Committee filed against the president's campaign, Russia, WikiLeaks and others in response to the 2016 hacking of the DNC's network.

Judge John G. Koeltl of the Southern District of New York determined that Russia, whom he calls the "primary wrongdoer," cannot be sued in U.S. courts, citing the Foreign Sovereign Immunities Act. The DNC had alleged a massive conspiracy among those entities to swing the election for Mr. Trump.

The judge also found other defendants, like the Trump campaign, could not be held liable for disseminating stolen DNC materials, citing First Amendment protections.

Get Breaking News Delivered to Your Inbox

"The First Amendment prevents such liability in the same way it would preclude liability for press outlets that publish materials of public interest despite defects in the way the materials were obtained so long as the disseminator did not participate in any wrongdoing in obtaining the materials in the first place," the judge wrote.

Mr. Trump seized on the decision, declaring "vindication" and "exoneration" in the decision one week after former special counsel Robert Mueller's Capitol Hill testimony shed no significant new light on any presidential wrongdoing. Mueller's report found there was not sufficient evidence to establish a criminal conspiracy between the Trump campaign and Russia.

"Wow! A federal Judge in the Southern District of N.Y. completely dismissed a lawsuit brought by the Democratic National Committee against our historic 2016 campaign for President," Mr. Trump tweeted Tuesday night. "The Judge said the DNC case was 'entirely divorced' from the facts, yet another total & complete....vindication & exoneration from the Russian, WikiLeaks and every other form of HOAX perpetrated by the DNC, Radical Democrats and others."

"This is really big 'stuff' especially coming from a highly respected judge who was appointed by President Clinton," he added. "The Witch Hunt Ends!"

In the months ahead of the 2016 election, WikiLeaks released nearly 20,000 internal DNC emails, many of which were related to Hillary Clinton. WikiLeaks later released thousands of emails belonging to John Podesta, who was Clinton's 2016 presidential campaign chairman.

— CBS News' Clare Hymes and Kathryn Watson contributed to this report