An Arizona inmate has pleaded guilty to raping a prison teacher and will likely spend the rest of his life behind bars.

Jacob Harvey entered the plea on rape, assault and kidnapping charges Monday for attacking the teacher in a classroom at the Eyman state prison in Florence in January 2014. The teacher was in the Pinal County courtroom when the 21-year-old changed his plea. Sentencing is next month.

The woman is suing the state over an attack she says left her traumatized.

Arizona prison officials are appealing a $14,000 fine state workplace safety regulators levied for not protecting the teacher.

Harvey was in the first year of a 30-year sentence for raping a suburban Phoenix woman when he assaulted the teacher. The new sentence starts when the first ends.