CIA Director Mike Pompeo slammed WikiLeaks as a “non-state hostile intelligence service” Thursday, but during the presidential campaign, he and now-President Donald Trump were all but singing the organization’s praises.

Pompeo declared it is, “time to call out WikiLeaks for what it really is -- a non-state hostile intelligence service often abetted by state actors like Russia,” a stark departure from comments he and Mr. Trump made months earlier, after WikiLeaks released thousands of emails revealing the inner-workings and woes of the Democratic National Committee. Pompeo on Thursday also accused WikiLeaks of collaborating with the Russian government -- a government Mr. Trump has hesitated to criticize -- to push out information with the agenda of weakening western democracies.

During the campaign, however, Pompeo seemingly cited WikiLeaks as a reliable source, pointing to the WikiLeaks emails as “proof” that the DNC favored pre-selected candidates. “Need further proof that the fix was in from Pres. Obama on down? BUSTED: 19,252 Emails from DNC Leaked by WikiLeaks,” the former Republican congressman from Kansas tweeted on July 24, 2016. Pompeo, questioned about the tweet in his confirmation hearings, said he didn’t recall his earlier tweet, denying that he ever considered WikiLeaks trustworthy or credible.

Get Breaking News Delivered to Your Inbox

But, Pompeo’s remarks also put him add odds with Mr. Trump’s most recent comments about the hacking organization. As recently as January, President Donald Trump applauded WikiLeaks for shedding light on DNC operations, and Mr. Trump was profuse in his praise for WikiLeaks before his election.

‘‘I love WikiLeaks!’’ the real estate mogul declared a month before the election at a rally in northeast Pennsylvania.

Mr. Trump also referred to WikiLeaks as a “treasure trove” of information. Days before the election in late October, he said WikiLeaks caught “crooked” former Secretary of State Hillary Clinton “in the act,” after WikiLeaks emails claimed Clinton’s foundation received $12 million in donations from Morocco’s king.

Huma calls it a "MESS," the rest of us call it CORRUPT! WikiLeaks catches Crooked in the act - again.#DrainTheSwamp https://t.co/juvdLIJPWu — Donald J. Trump (@realDonaldTrump) October 21, 2016

And Mr. Trump’s positive WikiLeaks references didn’t stop after he was elected.

In January, before his inauguration, Mr. Trump criticized the DNC’s lack of sufficient cyber security and seemed to cite Assange as an authority in the field, amid concerns that the Russian government used cyberattacks in the election. The House and Senate Intelligence committees are now investigating any Russian meddling in the 2016 campaign.

Julian Assange said "a 14 year old could have hacked Podesta" - why was DNC so careless? Also said Russians did not give him the info! — Donald J. Trump (@realDonaldTrump) January 4, 2017

The tweets continued into the next day.

The dishonest media likes saying that I am in Agreement with Julian Assange - wrong. I simply state what he states, it is for the people.... — Donald J. Trump (@realDonaldTrump) January 5, 2017