An Endicott man will spend up to 18 years in prison for possessing thousands of computer files containing child pornography.

Kenneth Buchanan mug shot provided by Broome County District Attorney

58-year-old Kenneth Buchanan was sentenced in Broome County court to the maximum term under a plea deal reached earlier this year.

Buchanan was arrested in June of last year following a search of his home that turned up years-worth of porn on his computer. Police reported confiscating 51 photos and 9 videos of a child under the age of 16 engaged in sexual activity.

He had pleaded not guilty to dozens of counts in January but entered a guilty plea in March to a 60-count child porn indictment.

Officials said the Endicott man had collected the images over the course of several years.

In addition to the prison sentence and post-release supervision, Buchanan will register as a sex offender.