Michael Cohen on Capitol Hill on Feb. 21, 2019. (Susan Walsh/AP)

An Internal Revenue Service employee has been charged with leaking confidential government reports that described financial transactions made by President Trump’s former personal lawyer Michael Cohen, according to court documents unsealed Thursday.

John Fry, an investigative analyst with the IRS in San Francisco, was charged with the unauthorized disclosure of suspicious-activity reports, or SARs. Such reports are meant to flag potentially unlawful financial conduct to government investigators but do not necessarily indicate wrongdoing.

According to the court documents, unsealed in federal court in San Francisco, Fry is accused of sharing the reports’ contents with Michael Avenatti, a lawyer who rose to national prominence representing adult-film actress Stormy Daniels in litigation arising from her claims of a sexual encounter with Trump more than a decade ago. Cohen pleaded guilty last year to arranging hush-money payments to Daniels and another woman who also alleged an affair with Trump.

Fry’s lawyer did not immediately respond to a request for comment. Court records show he appeared briefly in court Thursday and was released on a $50,000 bond. Court records do not show whether a plea was entered.

Avenatti, who made the information public by posting it on social media, did not immediately respond to a message seeking comment. He said on Twitter that he did nothing wrong.

A lawyer for Cohen declined to comment.

Fry’s case is the second in recent months in which a government employee has been charged with disclosing suspicious-activity reports related to persons of interest in special counsel Robert S. Mueller III’s investigation. Mueller is investigating Russian interference in the 2016 U.S. election.

In October, the Justice Department charged a senior Treasury Department official with giving a journalist the details of SARs involving financial transactions connected to former Trump campaign chairman Paul Manafort and other associates of the president’s.

The new case cites reporting by The Washington Post and the New Yorker and alleges that Fry was the root source of information for those stories.

Authorities say that on May 4, 2018, Fry used his access to a government database to look up five SARs on Cohen and called Avenatti “immediately after downloading” the documents.

A May 8 article published by The Post and based on information provided by Avenatti, traced the flows of money into and out of Essential Consultants, a limited-liability company Cohen used in part to arrange a hush-money payment for Daniels during the 2016 election campaign.

That transaction led to Cohen’s pleading guilty to the charge of violating campaign finance law. He also pleaded guilty to other crimes and is due to testify publicly to Congress next week before heading to prison in early March.

Cohen is to appear for a private hearing Tuesday before the Senate Intelligence Committee, his lawyer confirmed. He also is to provide public testimony Wednesday before the House Oversight Committee and then additional private testimony Thursday before the House Intelligence Committee.

Four days after The Post’s story was published in May, according to the criminal complaint, Fry allegedly placed a call to Ronan Farrow, a reporter for the New Yorker. Later that month, Farrow wrote a story about an unidentified law enforcement official who shared the SARs because he had grown alarmed after being unable to locate two such documents regarding Cohen in a government database.

A New Yorker spokeswoman declined to comment.

Within the Treasury Department, officials sometimes remove SARs related to high-profile or sensitive cases from the searchable databases to prevent officials without a direct role in particular cases from casually looking at the information, according to court documents.

The criminal complaint alleges that Fry had no valid work-related reason to look at SARs involving Cohen. By conducting a search of Fry’s phone, investigators obtained WhatsApp text messages between Fry and Farrow during the period in question, according to the criminal complaint.

The charging document said that Fry confessed when confronted by federal agents in November.

“Fry confessed to verbally providing SAR information to Avenatti. Fry also admitted that he sent Avenatti a screenshot of the narrative. Fry stated that Reporter-1 (Farrow) contacted him to verify the information supplied to Reporter-1 by Avenatti,” the complaint said.

After Fry was charged, Avenatti said on Twitter: “Neither I nor R. Farrow did anything wrong or illegal with the financial info relating to Cohen’s crimes... And if we did (we didn’t), then every reporter in America would be jailed and unable to do their job.”

Matt Zapotosky contributed to this report.