BLISS, N.Y. (WIVB) — A Wyoming County man could spend up to 20 years in prison after pleading guilty to attempted receipt of child pornography.

Officials say 42-year-old Bliss resident Daniel Hays engaged in sexually explicit conversations, both online and through text, with someone he believed to be an 11-year-old girl.

This person was actually an undercover New York State police investigator, prosecutors say.

In these conversations, which officials say took place in April and May, they say Hays discussed sex, and asked for nude photographs.

In May, prosecutors say Hays traveled roughly two hours with the purpose of having sex. He was arrested when he arrived, and officials say he had candy that he purchased as a gift.

Hays will be sentenced on October 19. In addition to prison time, he could also be forced to pay a $250,000 fine.