TUSCALOOSA, Ala. (AP) — A judge has sentenced a former Alabama educator to more than 30 years in prison on child pornography charges.

U.S. District Judge Scott Coogler imposed the sentence Thursday on 40-year-old Brett Kirkham of Tuscaloosa.

Kirkham is a former principal at Hueytown Middle School in suburban Birmingham and a past human resources director for Jefferson County schools. He pleaded guilty in March to possessing a pornographic image of a child and enticing a minor for sex.

The educator was accused of having sex with a student in two counties. Records show Kirkham was once the student's principal at the school.

Kirkham was arrested following a search of his home in June 2016 and has been in jail since.

Prosecutors agreed to drop state charges against Kirkham in a plea deal.