Prolonged sleep deprivation results in cognitive deficits. In rats, for example, sleep deprivation impairs spatial learning and hippocampal long-term potentiation. We tested the effects of sleep deprivation on learning in a Pavlovian fear conditioning paradigm, choosing a sleep deprivation paradigm in which REM sleep was completely prevented and non-REM sleep was strongly decreased. During conditioning, rats were given footshocks, either alone or paired with a tone, and tested 24 h later for freezing responses to the conditioning context, and to the tone in a novel environment. Whereas control animals had robust contextual learning in both background and foreground contextual conditioning paradigms, 72 h of sleep deprivation before conditioning dramatically impaired both types of contextual learning (by more than 50%) without affecting cued learning. Increasing the number of footshocks did not overcome the sleep deprivation-induced deficit. The results provide behavioural evidence that REM/non-REM sleep deprivation has neuroanatomically selective actions, differentially interfering with the neural systems underlying contextual learning (i.e. the hippocampus) and cued learning (i.e. the amygdala), and support the involvement of the hippocampus in both foreground and background contextual conditioning.