A Metairie man set for trial this week for possession of child pornography instead pleaded guilty as charged in exchange for a five-year prison sentence, Jefferson Parish District Attorney Paul Connick’s office said Monday.

William Shiell, 49, was arrested in May 2014 after a Jefferson Parish Sheriff’s Office task force found videos and images of prepubescent boys and girls engaged in sexual acts on his home computer.

Shiell’s five-year sentence is the minimum that was required by law at the time he was arrested. Three months later, the state doubled the penalty to 10 to 40 years, Connick’s office said.

Shiell will also have to register as a sex offender for 25 years beginning with his release from prison.

Judge Ellen Shirer Kovach of the 24th Judicial District Court handed down the sentence after accepting the plea, and allowed Shiell to huddle with his tearful family in the courtroom before he was fingerprinted and taken away in handcuffs to begin his prison sentence, Connick’s office said.

Assistant District Attorney Douglas Rushton prosecuted the case.

Follow Chad Calder on Twitter, @Chad_Calder.