Consolidation of extinction learning is a primary mechanism disrupted in posttraumatic stress disorder (PTSD), associated with hypoactivity of the ventromedial prefrontal cortex and hippocampus. A role for rapid eye movement (REM) sleep disturbances in this failure to consolidate extinction learning has been proposed. We performed functional magnetic resonance imaging (fMRI) with simultaneous skin conductance response (SCR) measurements in 16 healthy participants during conditioning/extinction and later recall of extinction. The visual stimuli were basic geometric forms and electrical shocks functioned as the unconditioned stimulus. Between the conditioning/extinction and recall sessions, participants received a 90-min sleep window in the sleep laboratory. This daytime sleep was polysomnographically recorded and scored by professionals blind to the study design. Only seven out of 16 participants had REM sleep; participants without REM sleep had a significantly slower decline of both SCR and neural activity of the laterodorsal tegmentum in response to electrical shocks during conditioning. At recall of fear extinction, participants with preceding REM sleep had a reduced SCR and stronger activation of the left ventromedial prefrontal cortex and bilateral lingual gyrus in response to the extinguished stimulus than participants lacking REM sleep. This study indicates that trait-like differences in shock reactivity/habituation (mediated by the brainstem) are predictive of REM sleep disruption, which in turn is associated with impaired consolidation of extinction (mediated by the ventromedial prefrontal cortex). These findings help understand the neurobiological basis and the temporal sequence of the relationship between shock exposure, disturbed sleep and impaired consolidation of extinction, as observed in PTSD.