An IRS analyst pleaded guilty Wednesday to leaking former Trump attorney Michael Cohen’s confidential financial records in 2018 to Michael Avenatti, the embattled celebrity lawyer.

John Fry, an investigative analyst at the IRS’s San Francisco office, was indicted Feb. 28 on charges that he unlawfully accessed and disclosed Suspicious Activity Reports (SARs) pertaining to Cohen and his businesses. He was also charged with misusing his government computer and illegally using a social security number. (RELATED: IRS Analyst Charged With Leaking Michael Cohen’s Financial Records)

He pleaded guilty to one count Wednesday, The Washington Post reported.

“John Fry was given access to sensitive and powerful government databases containing people’s private financial information,” said David L. Anderson, the U.S. attorney in San Francisco, according to WaPo.

“And he was given that access in order to do his job as an investigative analyst. Fry thought that his politics were more important than his obligation to follow the law, and in that he was mistaken.”

Prosecutors alleged that on May 4, 2018, Fry accessed the Treasury Department’s Financial Crimes Enforcement Network (FinCEN) system and obtained five SARs related to Cohen. Banks provide SARs to the Treasury Department when they detect suspicious or potentially suspicious activity in a client’s account.

Fry then “immediately” phoned Avenatti, who at the time was embroiled in a battle with Cohen over payments to Stormy Daniels. After their phone call, Fry conducted another search of IRS systems for Cohen records, prosecutors have said.

Avenatti provided the information to The Washington Post, which published a story based on the documents May 8, 2018. He also connected Fry to journalist Ronan Farrow, who published a story May 16, 2018. Farrow quoted Fry anonymously defending his leaks, claiming that he accessed the documents because he believed they had been removed from IRS systems as part of a cover up. That theory proved wrong, as the Cohen documents were removed from regular IRS systems because he was under criminal investigation at the time.

Fry faces up to five years in prison in the case, though he is likely to get far less jail time than that.

SARs of numerous Trump associates caught up in the Russia probe have been leaked to the media over the past several years. Natalie Mayflower Sours Edwards, a senior official at FinCEN, was arrested Oct. 17, 2018, and charged with leaking multiple SARs to BuzzFeed News.

Avenatti and Cohen have had their own legal problems. Prosecutors in New York and California indicted Avenatti on a slew of charges, including embezzlement and extortion. He is accused of defrauding Daniels, a porn star, out of $300,000 in book advance money. He is also accused of withholding $4 million in settlement money from a paraplegic, mentally ill client he represented in a lawsuit against Los Angeles County.

Cohen is serving a three-year prison sentence for tax evasion, bank fraud, and making an illegal campaign contribution in the 2016 election.

Cohen acknowledged paying Daniels $130,000 in October 2016 to keep her from going to the press about an alleged affair she had with Donald Trump in 2006.

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.