The ability to encode information into long-term memory is not a passive process but can be influenced by motivational factors. While the mesolimbic system has long been associated with reward-driven memory enhancement, the precise neurobiology of processing aversive events and their effects on declarative learning remain unclear. To address this issue, human subjects encoded a series of scene images, which was combined with cues predicting an aversive electric shock with different probabilities (0.2, 0.5, 0.8). Subsequently, recognition memory for the scenes was tested using a remember/know procedure. In a behavioral experiment, shock probability had linear effects on familiarity and inverted u-shaped effects on recollection. While the behavioral effect was absent in experiment 2 (fMRI), at the neural level encoding-related activity in the hippocampus mimicked the recollection specific quadratic effect, whereas activity in the anterior parahippocampal gyrus mirrored the familiarity specific linear relationship that was evident in experiment 1. Importantly, the probability of upcoming shocks was linearly coded in the substantia nigra / ventral tegmental area, and pain associated brain regions, such as the insula, responded to shock delivery. Our results demonstrate that anticipating primary aversive events recruits the human mesolimbic system and differentially modulates declarative memory functions via medial temporal lobe structures. Hum Brain Mapp 35:4594–4606, 2014. © 2014 Wiley Periodicals, Inc.