Growing evidence places the gestational period as a unique moment of heightened neuroplasticity in adult life. In this longitudinal study, we unveiled a U-shaped trajectory in gray matter (GM) volume, which dips in late pregnancy and partially recovers during postpartum. These changes were most prominent in brain regions associated with the Default Mode and Frontoparietal Network, which also showed an increased global efficiency and density connectivity. The U-shaped trajectory was predominantly linked to gestational factors, as it was only present in gestational mothers and correlated with fluctuations in estrogens over time. Finally, the mother’s mental health status mediated the relationship between postpartum GM volume recovery and maternal attachment at six months postpartum. This research sheds light on the complex interplay between hormones, brain development, and behavior during the transition to motherhood. It addresses a significant knowledge gap in the neuroscience of human pregnancy and opens new possibilities for interventions aimed at enhancing maternal health and well-being.