(CNN) Federal prosecutors have charged an analyst with the Internal Revenue Service with illegally disclosing confidential reports about Michael Cohen's bank records that revealed that President Donald Trump's former lawyer had sought to profit from his proximity to the White House, according to a complaint unsealed on Thursday.

The analyst, John C. Fry, was charged with the unauthorized disclosure of a document called a suspicious activity report, which banks file when they review transactions that raise red flags.

CNN previously reported that the Justice Department was investigating the leak last year of the confidential reports related to Cohen's banking activity.

Fry, an investigative analyst with the IRS's law enforcement arm, is accused of turning over the reports in the spring of 2018 to an attorney, Michael Avenatti, and of confirming confidential banking information in them to a reporter for The New Yorker, according to the complaint, which was filed under seal earlier this month.

On Thursday, Fry appeared before US Magistrate Judge Laurel Beeler in federal court in San Francisco, according to the US Attorney's Office for the Northern District of California, which charged Fry, and was released on a $50,000 bond.

Read More