WASHINGTON -- A former FBI agent arrested in 2012 on child pornography charges has admitted to being the source of a disclosure to the Associated Press about a foiled al Qaeda plot, Justice Department officials said Monday.

Donald Sachtleben, a 55-year-old from Carmel, Ind., was an FBI agent for 25 years and worked on major cases, including the Oklahoma City bombing and the hunt for the Unabomber. According to paperwork filed in federal court, Sachtleben provided the national security information to the AP just nine days before he was arrested on the child porn charges, in a separate investigation.

Justice Department officials said in a release that Sachtleben "was identified as a suspect in the case of this unauthorized disclosure only after toll records for phone numbers related to the reporter were obtained through a subpoena and compared to other evidence collected during the leak investigation." Federal investigators then obtained a search warrant that authorized a "more exhaustive search" of Sachtleben's cell phone, computer and other electronic media.

Sachtleben exchanged text messages with an Associated Press reporter in late April and early May of 2012 before making the disclosure in a phone call, according to a court document. That leak led to an AP story that revealed the role of an undercover agent in al Qaeda's inner circle, federal officials said.

The leak was different from that of a whistleblower because Sachtleben "did not believe that he was exposing government waste, fraud, abuse, or any other kind of government malfeasance or misfeasance" by disclosing the information, according to the statement of offense he signed.

He also agreed to plead guilty to the child pornography charges. In that case, authorities tracked Sachtleben down by his email address after searching the computer of a different child pornography offender.

"I am deeply sorry for my actions," Sachtleben said in a statement sent to The Huffington Post. "While I never intended harm to the United States or to any individuals, I do not make excuses for myself. I understand and accept that today’s filings start the process of paying the full consequences of my misconduct, and I know that the justice system I once served so proudly will have its say."

U.S. Attorney Ron Machen of the District of Columbia said the "unprecedented investigative efforts by prosecutors and FBI agents and analysts" led to the discovery of Sachtleben's "egregious betrayal of our national security."

"This prosecution demonstrates our deep resolve to hold accountable anyone who would violate their solemn duty to protect our nation’s secrets and to prevent future, potentially devastating leaks by those who would wantonly ignore their obligations to safeguard classified information," Machen said.

If the judge accepts the terms of the plea agreement, Sachtleben will spend more than 11 years in federal prison: 43 months for the leak and 97 months on the child porn charges.