Postpartum depression, which affects approximately 15% of new mothers, is associated with impaired mother-infant interactions and deficits in cognitive function. Exposure to stress during pregnancy is a major risk factor for postpartum depression. However, little is known about the neural consequences of gestational stress. The medial prefrontal cortex (mPFC) is a brain region that has been linked to stress, cognition, maternal care, and mood disorders including postpartum depression. Here we examined the effects of chronic gestational stress on mPFC function and whether these effects might be linked to structural modifications in the mPFC. We found that in postpartum rats, chronic gestational stress resulted in maternal care deficits, increased depressive-like behavior, and impaired performance on an attentional set shifting task that relies on the mPFC. Furthermore, exposure to chronic stress during pregnancy reduced dendritic spine density on mPFC pyramidal neurons and altered spine morphology. Taken together, these findings suggest that pregnancy stress may contribute to postpartum mental illness and its associated symptoms by compromising structural plasticity in the mPFC.