Hippocampal gastrin-releasing peptide receptors (GRPR) regulate memory formation and extinction, and disturbances in GRPR signaling may contribute to cognitive impairment associated with neurodevelopmental disorders. Histone acetylation is an important epigenetic mechanism that regulates gene expression involved in memory formation, and histone deacetylase inhibitors (HDACis) rescue memory deficits in several models. The present study determined whether inhibiting histone deacetylation would prevent memory impairments produced by GRPR blockade in the hippocampus. Male Wistar rats were given an intrahippocampal infusion of saline (SAL) or the HDACi sodium butyrate (NaB) shortly before inhibitory avoidance (IA) training, followed by an infusion of either SAL or the selective GRPR antagonist RC-3095 immediately after training. In a second experiment, the infusions were administered before and after a retention test trial that served as extinction training. As expected, RC-3095 significantly impaired consolidation and extinction of IA memory. More importantly, pretraining administration of NaB, at a dose that had no effect when given alone, prevented the effects of RC-3095. In addition, the combination of NaB and RC-3095 increased hippocampal levels of the brain-derived neurotrophic factor (BDNF). These findings indicate that HDAC inhibition can protect against memory impairment caused by GRPR blockade.