President Trump on Friday celebrated a federal judge this week tossing out a lawsuit that claimed the Trump campaign and former adviser Roger Stone colluded with WikiLeaks and the Russian government to publish hacked Democratic National Committee emails during the presidential election.

“Just won lawsuit filed by the DNC and a bunch of Democrat crazies trying to claim the Trump Campaign (and others), colluded with Russia,” Trump tweeted Friday. “They haven’t figured out that this was an excuse for them losing the election!”

U.S. District Court Judge Ellen Huvelle said in a ruling on Tuesday that the allegations of conspiracy were insubstantial to proceed in court.

The judge said her ruling is based on the technicalities of the lawsuit and doesn’t take a position on whether the Trump campaign and its officials actually conspired with the Russians during the election.

JUDGE THROWS OUT SUIT ALLEGING TRUMP CAMPAIGN CONSPIRED WITH RUSSIANS IN HACK

"This is the wrong forum for plaintiffs’ lawsuit. The court takes no position on the merits of plaintiffs’ claims," Huvelle wrote.

The lawsuit was brought by two DNC donors, Roy Cockrum and Eric Schoenberg, and former DNC staffer Scott Comer, who alleged that the publication of the emails violated their privacy and that the Trump campaign and Stone engaged in an illicit activity.

In an email to Fox News, Stone said he is “gratified and delighted” by the ruling.

“Even though the case was not decided on this basis, plaintiffs provided no evidence or proof whatsoever of their central left-wing conspiracy theory: that I somehow worked with the Russian state to hack the DNC e-mail servers and shared the fruits of this alleged hacking with Wikileaks or the Trump campaign,” Stone said. “This is false and can therefore never be proven in any jurisdiction.”

The DNC itself wasn’t part of the suit, though it had brought a separate lawsuit back in April, accusing top Trump campaign officials, including Trump's son Donald Jr. and Trump's son-in-law Jared Kushner of colluding with the Russians.

Stone’s role in WikiLeaks activities raised concerns after the revelations that he reportedly exchanged messages with both WikiLeaks and Guccifer 2.0 – a social media account that U.S. intelligence agencies believe was part of the “Russian military intelligence” effort to spread the hacked emails.

Fox News’ Lukas Mikelionis contributed to this report.