Cross-frequency coupling supports the organization of brain rhythms and is present during a range of cognitive functions. However, little is known about whether and how long-range cross-frequency coupling across distant brain regions subserves working memory. Here we report that theta-slow gamma coupling between the hippocampus and medial prefrontal cortex (mPFC) is augmented in a genetic mouse model of cognitive dysfunction. This increased cross-frequency coupling is observed specifically when the mice successfully perform a spatial working memory task. In wild-type mice, increasing task difficulty by introducing a long delay or by optogenetically interfering with encoding, also increases theta-gamma coupling during correct trials. Finally, epochs of high hippocampal theta-prefrontal slow gamma coupling are associated with increased synchronization of neurons within the mPFC. These findings suggest that enhancement of theta-slow gamma coupling reflects a compensatory mechanism to maintain spatial working memory performance in the setting of increased difficulty.