Exposure of the mother to adverse events during pregnancy is known to induce pathological programming of the HPA axis in the progeny, thereby increasing the vulnerability to neurobehavioral disorders. Maternal care plays a crucial role in the programming of the offspring, and oxytocin plays a key role in mother/pup interaction. Therefore, we investigated whether positive modulation of maternal behavior by activation of the oxytocinergic system could reverse the long-term alterations induced by perinatal stress (PRS; gestational restraint stress 3 times/day during the last ten days of gestation) on HPA axis activity, risk-taking behavior in the elevated-plus maze, hippocampal mGlu5 receptor and gene expression in Sprague-Dawley rats. Stressed and control unstressed dams were treated during the first postpartum week with an oxytocin receptor agonist, carbetocin (1 mg/kg, i.p.). Remarkably, reduction of maternal behavior was predictive of behavioral disturbances in PRS rats as well as of the impairment of the oxytocin and its receptor gene expression. Postpartum carbetocin corrected the reduction of maternal behavior induced by gestational stress as well as the impaired oxytocinergic system in the PRS progeny, which was associated with reduced risk-taking behavior. Moreover, postpartum carbetocin had an anti-stress effect on HPA axis activity in the adult PRS progeny and increased hippocampal mGlu5 receptor expression in aging. In conclusion, the activation of the oxytocinergic system in the early life plays a protective role against the programming effect by adverse experiences and could be considered as a novel and powerful potential therapeutic target for stress-related disorders.