Memory formation is a multi-stage process that initially requires cellular consolidation in the hippocampus, after which memories are downloaded to the cortex for maintenance, in a process termed systems consolidation1. Epigenetic mechanisms regulate both types of consolidation2-7, but histone variant exchange, in which canonical histones are replaced with their variant counterparts, is an entire branch of epigenetics that has received limited attention in the brain and has never, to our knowledge, been studied in relation to cognitive function. Here we show that histone H2A.Z, a variant of histone H2A, is actively exchanged in response to fear conditioning in the hippocampus and the cortex, where it mediates gene expression and restrains the formation of recent and remote memory. Our data provide evidence for H2A.Z involvement in cognitive function and specifically implicate H2A.Z as a negative regulator of hippocampal consolidation and systems consolidation, probably through downstream effects on gene expression. Moreover, alterations in H2A.Z binding at later stages of systems consolidation suggest that this histone has the capacity to mediate stable molecular modifications required for memory retention. Overall, our data introduce histone variant exchange as a novel mechanism contributing to the molecular basis of cognitive function and implicate H2A.Z as a potential therapeutic target for memory disorders.