Learned fear often relapses after extinction, suggesting that extinction training generates a new memory that coexists with the original fear memory; however, the mechanisms governing the expression of competing fear and extinction memories remain unclear. We used activity-dependent neural tagging to investigate representations of fear and extinction memories in the dentate gyrus. We demonstrate that extinction training suppresses reactivation of contextual fear engram cells while activating a second ensemble, a putative extinction engram. Optogenetic inhibition of neurons that were active during extinction training increased fear after extinction training, whereas silencing neurons that were active during fear training reduced spontaneous recovery of fear. Optogenetic stimulation of fear acquisition neurons increased fear, while stimulation of extinction neurons suppressed fear and prevented spontaneous recovery. Our results indicate that the hippocampus generates a fear extinction representation and that interactions between hippocampal fear and extinction representations govern the suppression and relapse of fear after extinction.