NASSAU COUNTY, Fla. -- A former Fernandina Beach High School teacher was sentenced to 20 years in prison and a lifetime of sex offender probation in connection to his relationship with an underage student authorities said.

Daniel Gregory Wright, 33, of Fernandina Beach, was convicted of three counts of custodial sexual battery, one count of tampering with evidence, three counts of electronic transfer of information harmful to minors and 31 counts of possession of photographs/ sexual performance by a child, according to the State Attorney's Office.

He pleaded guilty to the charges in November 2015, prosecutors said.

RELATED: Former Fernandina Beach teacher pleads guilty to sex crimes

Wright was arrested in June 2014 after investigators became aware of his relationship with a student and then found dozens of images of child pornography on his phone, prosecutors said.