A former FBI explosives expert said on Monday he would plead guilty to revealing secret information for an Associated Press story about a US intelligence operation in Yemen in 2012.
The story led to a leaks investigation and the seizure of AP phone records in the government's search for the information's source.
Donald Sachtleben, 55, of Carmel, Indiana, said in court papers that he provided details of the operation to a reporter. Four months ago, Sachtleben also acknowledged he distributed and possessed pornographic images of underage girls.
He agreed to a prison sentence of three years and seven months for telling the news agency of the bomb plot, in addition to eight years and one month for the unrelated child pornography charges, the court papers said.
If accepted by a judge, the prison sentence would be the longest ever handed down in a civilian court for a leak of classified information to a reporter.
The justice department said in a statement that its pursuit of Sachtleben was made easier by the child pornography investigation, but that Sachtleben was not identified as a suspect in the leaks case until after investigators had analysed the AP phone records and compared them with other evidence in their possession.
AP spokesman Paul Colford said, "We never comment on sources."
The deal is the latest legal action in the Obama administration's aggressive pursuit of people it believes have revealed government secrets, including seeking records and even testimony of journalists who prosecutors believe were given classified information and then published stories about it.
Senior prosecutor Ronald Machen, who was appointed by the attorney-general Eric Holder to investigate, said in a statement: "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."
Monday's court filing stems from an investigation launched by the justice department shortly after AP reported that US intelligence had learned that al-Qaida's Yemen branch hoped to launch a spectacular attack using a new, nearly undetectable bomb aboard a US-bound airliner around the anniversary of Osama bin Laden's death.
The AP's story on 7 May 2012 attributed details of the operation, including that the FBI had the bomb in its possession, to unnamed government officials.
CIA director John Brennan has called the leak "irresponsible and damaging", while Holder said the story was the result of "a very serious leak, a very grave leak".
FBI assistant director Valerie Parlave said in a statement that the bureau "will continue to take all necessary steps to pursue such individuals who put the security of our nation and the lives of others at risk by their disclosure of sensitive information".
Just over a year after the story appeared, on 10 May, the justice department informed AP that it had secretly obtained nearly two months of call records for more than 20 telephone lines used by AP reporters and editors, including some who worked on the story.
AP protested that the government's actions were likely to inhibit investigative journalism and the company and its reporters did not co-operate in the investigation. AP chief executive Gary Pruitt called the records' seizure a "massive and unprecedented intrusion" into how news organisations gather information.
The court records do not identify AP or name the reporter who communicated with Sachtleben. But the headline from the AP story that ran on 7 May 2012 is reproduced in the federal court records and Larry Mackey, Sachtleben's Indianapolis-based lawyer, said the AP was the news organisation described in the papers.
Sachtleben spent 25 years as an FBI special agent bomb technician and worked on major cases involving terrorist attacks, the government said. He retired in 2008, but was rehired as an FBI contractor and kept his "top secret" security clearance and access to the FBI lab in Quantico, Virginia.
In court papers, Sachtleben said he visited the FBI lab on the morning of 2 May 2012, at the very time that FBI experts were examining the bomb. Sachtleben shared that information with a reporter the same morning, the government said.
The AP story ran five days later. For several days the news organisation had agreed to the Obama administration's requests not to publish it.
The child pornography investigation did not become public until 11 May, when the FBI searched Sachtleben's home and seized a laptop from his truck in the driveway. The FBI said it found 30 photos and videos of child pornography on the computer.
Sachtleben was arrested the same day. The government said it began investigating Sachtleben for child pornography after an email address linked to him popped up on a known child-porn web site.
Sachtleben apologised in a brief, three-sentence statement that his attorneys released on his behalf on Monday afternoon.
"I am deeply sorry for my actions," he said. "While I never intended harm to the United States or to any individuals, I do not make excuses for myself."
The justice department said it had already had in its possession, as part of the child pornography investigation, Sachtleben's mobile phone, computer and other electronic media, including a CD/DVD containing classified information.
But the department said in a statement that it was able to link Sachtleben to the unauthorised disclosures about the Yemen plot only after investigators had analysed the seized AP phone records and compared them with other evidence already in their possession.
Based on the analysis, they were able to get a search warrant for a new and more thorough look at his phone and computer, the department said.