The American government found out about the memo, which was said to express confidence that the attorney general at the time, Loretta Lynch, would not let an investigation into Hillary Clinton’s use of a private email server go too far. Mr. Comey was said to worry that if Ms. Lynch made and announced the decision not to charge Ms. Clinton, Russia would put out the memo to make it seem illegitimate, leading to his unorthodox decision to announce that the F.B.I. was recommending against charges in the matter.
The Justice Department under then-President Donald Trump, who fired Mr. Comey and considered him an enemy, sought for years to see whether it could find evidence sufficient to charge him with the crime of making unauthorized disclosures of classified information — a push that eventually came to focus on whether he had anything to do with The Times learning about the existence of the document Russian hackers had stolen.
The long-running leak investigation into Mr. Comey was seen inside of the Justice Department as one of the most politicized and contentious, even by the standards of a department that had been prevailed upon in several instances to use leak investigations and other policies concerning book publication to attack former officials who criticized Mr. Trump.
Throughout last year, prosecutors talked about whether or not to close the leak investigation into Mr. Comey, according to two people familiar with the case, in part because there seemed to be little evidence to show that the former FBI director had shared classified information with the press.
Last fall, department officials discussed whether the investigation had run its course and prosecutors should draft a declination memo that would explain why Mr. Comey would not be prosecuted, one of the people said. But the F.B.I. and the career prosecutors working on the case wanted to keep the investigation open, the people said, and in January prosecutors obtained a special court order to require Google to turn over data on the reporters’ emails.
With Mr. Trump soon to be out of office, the order was controversial among some inside of the department, according to two people with knowledge of the case. It was seen as unusually aggressive for a case that would likely end in no charges. During the transition from the Trump to the Biden administration, at least one official wrote in a memo that the case should be closed, according to a person familiar with the transition.
In the court filings seeking to compel Google to turn over logs of who was communicating with the four reporters who wrote that story, the Justice Department persuaded the judge that the secrecy was justified because, as the judge wrote on Jan. 5, “there is reason to believe that notification of the existence of this order will seriously jeopardize the ongoing investigation, including by giving targets an opportunity to destroy or tamper with evidence.”