Years before his Justice Department charged WikiLeaks founder Julian Assange with conspiracy, Donald Trump praised the website for disclosing damaging information about his political opponents and encouraged his millions of supporters to read the organization’s latest document dumps.

But on Thursday, after the Justice Department unsealed an indictment charging Assange for actions stemming from WikiLeaks’ 2010 publication of classified diplomatic and military documents, Trump acted as if he’d never heard of the anti-secrecy group.

“I know nothing about WikiLeaks. It’s not my thing,” Trump told reporters in the Oval Office. “I know there is something having to do with Julian Assange.”

In fact, Trump was one of WikiLeaks’ most vocal supporters on the campaign trail, once confessing to supporters at a rally in Ohio that he almost didn’t get off his plane because “they were just announcing new WikiLeaks, and I wanted to stay there, but I didn’t want to keep you waiting.”

“Boy, I love reading those WikiLeaks,” Trump said.

Trump praised WikiLeaks many times in 2016, particularly as the presidential campaign entered the home stretch in October and the group began dribbling out emails of Clinton’s campaign chairman, John Podesta, which prosecutors allege were stolen by Russian government hackers.

At a campaign stop in Pennsylvania on Oct. 10, Trump declared, “I love WikiLeaks.”

“This WikiLeaks stuff is unbelievable,” Trump said two days later in Florida, as the site continued to post embarrassing stolen emails. “It tells you the inner heart; you gotta read it.”

Thursday’s indictment of Assange, who is in British custody pending a U.S. extradition request, marks an awkward evolution in the president’s affections. The former WikiLeaks fan now runs a government that seeks to imprison Assange and likens him to the head of a hostile foreign intelligence service.

As WikiLeaks released Democratic Party emails in 2016, members of Trump’s campaign were in contact with the group.

On the same day Trump told supporters in Florida to read WikiLeaks, the group urged Donald Trump Jr. to promote its cache of stolen emails, sending him a link to it in a private Twitter message, according to correspondence Trump Jr. later disclosed.

Two days after WikiLeaks’ request, he tweeted the link and encouraged his followers to “read about all the corruption and hypocrisy. . . . ”

Trump Jr. didn’t respond to many of WikiLeaks’ messages. But he told his brother-in-law Jared Kushner and other senior campaign advisers that he was in touch with the group, The Washington Post has reported.

The most direct contact between the Trump campaign and WikiLeaks appears to have run through Roger Stone, a GOP operative and longtime Trump friend. He boasted publicly in August 2016 that he was in contact with Assange, hinting that WikiLeaks would release more material that would damage the Clinton campaign before the election.

Stone has maintained that he was never in contact with Assange and that he had no advance knowledge of WikiLeaks’ plans. In January of this year, he was charged with lying to Congress about his efforts to make contact.

In court documents, prosecutors from the special counsel’s office alleged that a senior Trump campaign official — it’s unclear who — was directed to contact Stone after WikiLeaks published internal Democratic Party emails in July 2016 and to find out what else WikiLeaks had in store.

After the election and a few weeks before he took office, Trump defended Assange and promoted his claims that Russia wasn’t the source of the emails, some of which also had been stolen from the Democratic National Committee.

“Julian Assange said ‘a 14 year old could have hacked Podesta’ — why was DNC so careless?” Trump tweeted. “Also said Russians did not give him the info!”

By then, the Department of Homeland Security and U.S. intelligence agencies had publicly stated Russia had stolen the emails and that their publication on WikiLeaks was “consistent with the methods and motivations of Russian-directed efforts” to interfere with the elections.

Trump later said he was merely repeating what Assange had said.

Once Trump took office, he grew quieter about WikiLeaks. But his administration took an aggressive turn against it.

In April 2017, under the leadership of Attorney General Jeff Sessions, Justice Department prosecutors looked for charges they might file against WikiLeaks members in connection with its 2010 publication of State Department cables and Pentagon documents, as well as any culpability the organization might have in the more recent disclosure of CIA computer-hacking tools, The Post reported at the time.

Under President Obama, the department decided not to pursue charges against WikiLeaks, concluding it would be like prosecuting a news organization that publishes classified information obtained from sources. The Justice Department left the case open.

The Trump administration looked for ways that WikiLeaks may have encouraged or directed its sources to break the law, which would undermine the argument that WikiLeaks was engaged in constitutionally protected speech. And Assange has been accused in the unsealed indictment of working in 2010 with Chelsea Manning, a U.S. Army intelligence analyst, to crack a Defense Department password to obtain classified material.

Support was also building in the intelligence community to go after WikiLeaks.

At the CIA, the newly installed director, Mike Pompeo, a former congressman from Kansas, had also been a fan of the website on the campaign trail, pointing to its leaks as evidence of Democratic malfeasance and corruption in the Clinton campaign.

Unlike Trump, Pompeo — because of his earlier position on the House Intelligence Committee — had been privy to classified material on WikiLeaks and how U.S. spy agencies saw it as an aggressor. That didn’t stop him from relishing Assange’s role in the 2016 race.

“He liked WikiLeaks because it was putting [Clinton] on the hot seat,” a former U.S. official with knowledge of his thinking said. “The saint becomes the villain when it’s your interests that are being exposed.”

His disposition changed when he confronted a damaging security breach upon his arrival as CIA director.

By then, CIA officials were aware that a small arsenal of cyberespionage tools had been stolen. On March 7, WikiLeaks began posting the weaponry online in a release dubbed “Vault 7.”

“That was the triggering event” for Pompeo, the former U.S. official said, speaking on the condition of anonymity to describe government deliberations.

Pompeo informed senior aides that he would make lashing out at WikiLeaks a focal point of an upcoming speech at a Washington think tank, his first public remarks as director. From the podium, he labeled WikiLeaks a “nonstate hostile intelligence service,” comparing it to a foreign government that tries to steal U.S. secrets and undermine national interests.

“It is time to call out WikiLeaks for what it really is — a nonstate hostile intelligence service often abetted by state actors like Russia,” Pompeo said.

He argued WikiLeaks wasn’t engaged in traditional journalism, signaling that the Trump administration might be ready to take up a constitutional debate.

“Julian Assange and his kind are not the slightest bit interested in improving civil liberties or enhancing personal freedom,” Pompeo said. “They have pretended that America’s First Amendment freedoms shield them from justice. They may have believed that, but they are wrong.”

Rosalind S. Helderman contributed to this report.