A prior sex offender has pleaded guilty after allegedly raping a 14-year-old girl and taking photos during the incident.