An Elizabethtown man was sentenced Monday to 3 to 6 years in state prison after claiming that an insect possessed him and caused him to download child pornography.

Ronald S. Martin, 54, was charged in May 2016 with 77 counts of possession of child pornography, court documents show.

Authorities found him in possession of material which included children who appeared to be as young as 7 or 8, according to the Dauphin County District Attorney's Office. Other images were of children who appeared to be under the age of 13 involved in explicit sexual acts.

Martin admitted to possessing the images on his computer, after initially suggesting he was the victim of a hack, officials said.

His wife was the one who called authorities, saying she was frustrated that her husband repeatedly viewed the pornographic material, according to the district attorney's office.

The couple told state police that, at some point after he was confronted about the material, Martin was crying and crawling on his hands and knees, stood up, and when he fell back down, a 6- to 8-inch bug with a million legs came crawling out of his mouth, officials said.

Martin implied to the investigating state trooper that the bug possessed him and it was the bug's fault that he download the child pornography, according to the district attorney's office.

In court Monday, however, Martin expressed remorse for his crime and told the judge that he was disgusted by his crime and takes full responsibility, officials said.