Despite the increase in the prevalence of postpartum depression among maternal disorder, its treatment outcomes remain suboptimal. Studies have shown that exercise can reduce postpartum depressive episodes in the mother, but the effects of exercise during pregnancy on maternal behavior and the potential mechanisms involved remain poorly understood. From the second day of pregnancy to the day of birth, dams exercised for 1h a day by running on a controlled wheel. The maternal behaviors of the dams were assessed on postpartum day 2 to postpartum day 8. Chronic restraint stress was applied from postpartum day 2 to day 12. Blood was collected on postpartum days 3 and 8, then subjected to ELISA to determine the serum concentration of prolactin. The weight of each dam and the food intake were recorded. Anxiety- and depression-like behavioral tests were conducted, and hippocampal neuroinflammation and prolactin receptor levels were measured. The dams exhibited elevated levels of anxiety and depression, decreased serum prolactin levels, decreased prolactin receptor expression, and activation of NLRP3-mediated neuroinflammation in the hippocampus following the induction of postpartum chronic restraint stress, which were reversed with controlled wheel running during pregnancy. Overall, the findings of this study revealed that the preventive effects of exercise during pregnancy on postpartum anxiety-and depression-like behaviors were accompanied by increased serum prolactin levels, hippocampal prolactin receptor expression and hippocampal NLRP3-mediated neuroinflammation.