Updated

A former Connecticut police captain who had faced up to 20 years in prison for possessing a massive trove of child pornography was sentenced to half that on Friday after his lawyer argued he suffered from job-related stress.

Former Granby Police Capt. David Bourque pleaded guilty last year after he was caught with more than 26,000 still and video images of child pornography. Federal authorities said it was one of the largest and most disturbing child pornography cases they've seen.

During Friday's sentencing hearing, Bourque told a federal judge in Hartford that he lost his way and "spiraled out of control."

In court papers filed Wednesday, Richard Brown, an attorney for Bourque, had argued for a lighter sentence based on an evaluation by a psychologist that concluded Bourque suffered PTSD, affecting his judgment. Brown said it did not excuse Bourque's conduct, but could be taken into account by a judge when he is sentenced on Friday.

"It is fair to note that his condition arose as a result of his dedication to serving the public for over 30 years," Brown wrote. "Wherefore, a reduction or modification under these circumstances would be justified."

Bourque's sick collection was found on his work-issued computer and a hard drive he owned. Federal prosecutors said Bourque's job was to investigate child pornography, which he did even as he collected his disturbing cache.

"The defendant amassed an enormous collection of photographs and videos that document and memorialize the sexual abuse of children," prosecutors wrote. "All are extremely disturbing; some are especially horrific."

Bourque resigned in June. Attempts to reach his attorney on Friday were not immediately successful.

On two occasions last spring, an undercover Connecticut State Police trooper assigned to the Connecticut State Police Computer Crimes Unit logged into a publicly available Internet file sharing program and downloaded several images of suspected child pornography from an account maintained by Bourque, according to court documents.

In April, police were given consent to search Bourque's office and work computers, which revealed a laptop and other computer components, including an external hard drive personally owned by Bourque. Most of the items were encrypted and Bourque later told investigators he had encrypted the hard drive to conceal his collection of child pornography.

After providing passwords to investigators, authorities found roughly 22,282 images and 4,084 videos of child pornography,  including depictions of infants and toddlers. Bourque had organized the collection in more than 300 subfolders, court documents say.

The Associated Press contributed to this report.