After implantation of EEG/electromyogram (EMG) electrodes, mice recovered for 6 days, during which they were habituated to gentle handling. On day 7, mice were transferred to a training context (context A) in which they underwent fear conditioning consisting of a 192-s acclimation, 20-s auditory CS, 20-s interval, and 2-s foot shock; this sequence was repeated five times. Mice were returned to their home cages and split into three groups for a 4-hour intervention involving continuous EEG/EMG recording. For control mice, white noise was played for the duration of the intervention. For NREM- and REM-cued mice, the auditory CS was presented for a total of 5 minutes, during either NREM or REM sleep, respectively. To account for differences in NREM and REM period lengths, CS presentation was allowed throughout REM periods in REM-cued mice but limited to a maximum of 30 seconds during NREM periods in NREM-cued mice. Background white noise was reduced during CS presentation so that for all three groups, the total sound pressure level was maintained at 50 dB throughout the intervention period. Twenty-three hours later, mice were placed into a novel context (context B) in which they underwent cued fear memory testing consisting of a 3-min acclimation and 3-min auditory CS. Mice were returned to their home cages. Five hours later, mice were placed in context A for 5 min for contextual fear memory testing. See methods for further details.