BAKERSFIELD, Calif. (KGET) — A former California Department of Corrections and Rehabilitation lieutenant was sentenced Wednesday to a year in jail after pleading no contest to trying to set up a sexual encounter with someone he believed was a 13-year-old girl.

Jose Donaciano Valdez received two years’ probation — the first year to be served in custody — and must register as a sex offender for at least 10 years before he can petition to be removed from the state’s registry. Valdez retired from CDCR following his arrest.

Valdez was one of 19 people arrested in an online sting operation conducted by the sheriff’s office from April 20 to 23. Sheriff’s officials say Valdez tried to meet someone he believed was a 13-year-old girl at a hotel. He was actually in contact with a detective posing as a minor online.

In October, Valdez pleaded no contest to contacting a minor with the intent to commit a sex act, and a related charge was dismissed. Valdez had been out on bail but was taken into custody immediately after Judge David Zulfa handed down the sentence.