A former FBI explosives expert was sentenced on Thursday to more than three years in prison for possessing and disclosing secret information, which he has said included intelligence he gave to the Associated Press for a story about a US operation in Yemen in 2012.

The story on Yemen led to a federal leaks investigation and the seizure of AP phone records in the government's search for the information's source.

Donald Sachtleben, 55, pleaded guilty to one count of disclosing and one count of possessing classified information. He was immediately sentenced by US district judge William T Lawrence, who told the 25-year veteran of the FBI: "Clearly, you have betrayed your nation."

Lawrence said Sachtleben's career in law enforcement put him "on the front lines" helping to protect the United States, including participating in the investigation of the September 11 attacks in New York.

"But you have also tarnished what … was [your] incredible reputation," Lawrence said.

AP spokesman Paul Colford in New York said: "We never comment on who our sources are."

At the same hearing, Lawrence sentenced Sachtleben to an additional eight years in prison in an unrelated child pornography case. He pleaded guilty to distributing and possessing pornographic images of underage girls.

Sachtleben delivered a more than 20-minute statement before he was sentenced. He apologized to family and friends, as well as former colleagues at the FBI for "breaking the bonds of trust" with them. He did not discuss his motives, though he said "it was never my intention to ever derive profit".

He partly blamed his actions on what he described as post-traumatic stress arising from his decades in the FBI participating in high-profile investigations, which also included the Oklahoma City bombing. He added he decided to promptly admit he leaked classified information after federal investigators approached him to prevent former co-workers from falling "under clouds of suspicion".

"I wanted to … make it absolutely clear that the crime I did was all on my own," he said.

Prosecutors did not broach Sachtleben's possible motive for the intelligence disclosures. But they said in court documents he was not acting "as any kind of 'whistleblower'" and his actions were "not the result of a desire to expose perceived waste, fraud, abuse, or other government misconduct".

As part of a plea agreement, prosecutors and Sachtleben agreed on a recommended sentence of three years, seven months on the national security charge and eight years, one month for child pornography, which is the sentence the judge imposed. Combined, he had faced a maximum sentence of 50 years behind bars.

The Justice Department said in a September statement its pursuit of Sachtleben began with the child pornography investigation. It added Sachtleben was not identified as a suspect in the leaks case until after investigators had analyzed the AP phone records and compared them to other evidence in their possession.

The Obama administration has aggressively pursued people it believes have revealed government secrets, including records of journalists who prosecutors believe were given classified information and then published stories about it.