The prosecutor's office said the suspect shared explicit photos with a detective who was posing as a 14-year-old girl.