WASHINGTON — Soon after he took over as C.I.A. director, Mike Pompeo privately told lawmakers about a new target for American spies: Julian Assange, the founder of WikiLeaks.

Intent on finding out more about Mr. Assange’s dealings with Russian intelligence, the C.I.A. began last year to conduct traditional espionage against the organization, according to American officials. At the same time, federal law enforcement officials were reconsidering Mr. Assange’s designation as a journalist and debating whether to charge him with a crime.

Mr. Pompeo and former Attorney General Jeff Sessions unleashed an aggressive campaign against Mr. Assange, reversing an Obama-era view of WikiLeaks as a journalistic entity. For more than a year, the nation’s spies and investigators sought to learn about Mr. Assange and his ties to Russia as senior administration officials came to believe he was in league with Moscow.

Their work culminated in prosecutors secretly filing charges this summer against Mr. Assange, which were inadvertently revealed in an unrelated court filing and confirmed on Friday by a person familiar with the inquiry. Taken together, the C.I.A. spying and the Justice Department’s targeting of Mr. Assange represented a remarkable shift by both the American government and President Trump, who repeatedly lauded WikiLeaks during the 2016 campaign for its releases of Democratic emails, stolen by Russian agents, that damaged his opponent, Hillary Clinton.