Special counsel Robert Mueller probed whether President Trump’s election campaign was involved in WikiLeaks’ publication of stolen Democratic emails — but found nothing illegal, Attorney General William Barr said Thursday.

He noted, however, that the emails were originally stolen by Russian agents — and the “publication of these types of materials would not be criminal unless the publisher also participated in the underlying hacking conspiracy.”

The extent of the campaign’s involvement in the email dump remained unclear once the long-awaited report into Mueller’s investigation was released later Thursday, as that section is heavily redacted due to an “ongoing matter.”

It notes that the campaign “showed interest in Wikileaks’ releases of hacked materials throughout the summer and fall of 2016” and that, according to former campaign adviser Rick Gates, “by the late summer of 2016, the Trump Campaign was planning a press strategy, a communications campaign, and messaging based on the possible release of Clinton emails by WikiLeaks.”

Gates also told Mueller’s team that, at one point, Trump said to him “that more releases of damaging information would be coming,” the report says.

The report also outlines communications between Trump’s eldest son, Donald Trump Jr., and WikiLeaks.

The organization first contacted him in September 2016 via direct message on Twitter, giving him the username and password to a yet-to-be-launched website focusing on Trump’s “unprecedented and dangerous” ties to Russia.

Trump Jr. subsequently emailed senior campaign staffers saying the login worked and asking “if we want to look into it,” per the report.

WikiLeaks messaged him again on Oct. 3, asking “you guys” to send out a link “alleging candidate Clinton had advocated using a drone to target [WikiLeaks founder] Julian Assange” — to which Trump Jr. responded that he’d already done so, and added, “what’s behind this Wednesday leak I keep reading about?”

Nine days later, the organization contacted Trump Jr. again, saying it had just released more emails from Hillary Clinton’s 2016 presidential campaign chair John Podesta, and offering a link to a site it said would help Trump in “digging through” the documents.

Trump Jr. tweeted the link out several days later.