A former Arizona Department of Corrections officer was sentenced to 11 years in prison for carrying on a sexual relationship with a minor even after a conviction for having sex with the same teen.

Robert Joseph Hamm, 34, pleaded guilty to two counts of sexual conduct with a minor in a case from earlier this year. He was given 1ƒ years on each of two counts of sexual conduct with a minor, to be served consecutively.

Pima County Superior Court Judge Richard Fields also sentenced Hamm on Monday to eight years in prison for violating his probation in a 2011 case involving the same minor girl.

In that case, Hamm served a year in prison after pleading guilty in 2011 to having sex with the then-14-year-old girl, who was the daughter of a friend.

Court documents from that case show Hamm admitted to police he had been involved in a relationship with the girl. Hamm told police that he knew having sex with the girl was wrong but that was drunk at the time the relationship started.

Police said the girl kept a detailed dairy of the encounters with Hamm, which the parents found and alerted police.

The relationship between Hamm and the girl resumed sometime after his release from prison in June 2012.

Court documents say the parents of the girl, now 16, discovered earlier this year the relationship was ongoing when they again found a diary detailing the affair.

Hamm had worked as a corrections officer in 2010 and 2011.

Contact reporter Patrick McNamara at 573-4241 or pmcnamara@azstarnet.com. On Twitter @pm929.