Attachment-related learning (that is, forming preferences for cues associated with the parent) defies the traditional rules of learning in that it seems to occur independently of apparent reinforcement1-young children prefer cues associated with their parent, regardless of valence (rewarding or aversive), despite the diversity of parenting styles2. This obligatory attraction for parental cues keeps the child nearby and safe to explore the environment; thus, it is critical for survival and sets the foundation for normal human cognitive-emotional behaviour. Here we examined the learning underlying this attraction in preschool-age children. Young children underwent an aversive conditioning procedure either in the parent's presence or alone. We showed that despite disliking the aversive unconditioned stimulus, children exhibited a behavioural approach for conditioned stimuli that were acquired in the parent's presence and an avoidance for stimuli acquired in the parent's absence, an effect that was strongest among those with the lowest cortisol levels. The results suggest that learning systems during early childhood are constructed to permit modification by parental presence.