Pima County Superior Court Judge Richard Fields on Thursday ruled in favor of a defendant whose attorney objected to media coverage of a sentencing hearing.

Robert Joseph Hamm’s attorney, Walter Palser, argued that filming the sentencing would place Hamm in physical danger once his prison term begins.

Hamm pleaded guilty to two counts of sexual conduct with a minor. He had previously worked as an Arizona Department of Corrections officer.

Palser said Hamm would face dangers in prison because of his past work in law enforcement.

When sentenced, this will be Hamm’s second stay in state prison.

He served a year in prison after pleading guilty in 2011 to having sex with the 14-year old daughter of a friend. After his release in 2012, Hamm again began a relationship with girl.

Court documents say the parents of the girl, now 16, discovered the relationship had begun again.

Hamm’s probation was revoked in June and he was returned to custody.

His sentencing hearing is scheduled for Monday.

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