GONZALES, LA (WAFB) - The former Mayor of Sorrento pleaded to 47 counts connected to possessing child pornography, animal cruelty and obstruction of justice on Tuesday. It was part of a plea deal Wilson Longanecker, Jr. took in exchange for 40 years in prison.

Longanecker did not answer questions or make any comments as guards shuffled him off to prison.

The ex-mayor pleaded guilty last year to possessing child pornography and animal cruelty after investigators with the Louisiana Attorney General's Cyber Crimes unit said they found pornographic videos of children, some as young as three years of age, downloaded on his computer hard drive. It was just one piece of evidence authorities said they seized from Longanecker's house on October 23, 2014.

Charlotte Guedry, spokeswoman for the 23rd Judicial District Attorney, said prosecutors had an iron clad case.

"This is something we were very, very, ready to go to trial for," Guedry said.

However, after considering the impact of the lengthy process on people in the community, including Longanecker's parents, wife, and three young children, Guedry said District Attorney Ricky Babin decided to offer Longanecker a deal. It was 40 years in prison with hard labor, 10 of them to be served with no possibility of probation, parole, or suspension of sentence, in exchange for a guilty plea.

"We are happy with the outcome. Forty years, is maybe, to some people not the greatest amount of time but it's time necessary to pay for those crimes," Guedry said.

Longanecker's attorney Andre Belanger spoke on his behalf.

"Mr. Longanecker has obviously failed his children, his wife, and his parents, and he is looking for the opportunity to restore his name and reputation," Belanger said.

Tim Pujol, an earlier attorney for Longanecker, had originally wanted his client to plead not guilty by reason of insanity, but that was not part of Tuesday's plea.

Longanecker, 43, was elected mayor of Sorrento in 2011 and served until 2013.