BAKERSFIELD, Calif. (KGET) — A 58-year-old man has pleaded no contest to attempting to meet for sex someone he believed was a 15-year-old girl but who actually was a police officer posing as a minor online.

Donald Steven Allmon pleaded no contest on Wednesday to contacting a minor to commit a sex offense, according to Superior Court records. Five other charges were dismissed.

Allmon faces a year in jail and sex offender registration at his July 7 sentencing hearing.

Police said they began investigating after Allmon contacted the undercover investigator’s decoy profile and continued communications for several weeks. Allmon was arrested May 23 in the 2100 block of Buena Vista Street after police said he tried to get away on a bike.