The massive use of herbicides, particularly glyphosate‐based herbicides (GBHs), raises several worries, notably their neurotoxic effects. Several studies have explored the consequences of developmental exposure. Our work aims to determine the impact of maternal exposure to GBH on behavioral disorders and memory deficits, as well as the involvement of oxidative stress in the hippocampus and prefrontal cortex. In addition, our study explores the neuroprotective properties of melatonin in male and female offspring. Pregnant Wistar rats were injected with GBH 75 mg/kg during gestation and lactation. After weaning, the offspring were treated with melatonin (4 mg/kg) from postnatal days 30–58. Our results show that GBH increases anxiety‐like behavior levels in offspring, as well as depression‐like behavior. GBH also impairs working memory in progeny. While markers of oxidative stress show a disturbance in lipid peroxidation and catalase activity, with a more pronounced effect in females, on the other hand, melatonin considerably attenuated the neurotoxic impact observed in the offspring, with higher efficacy in females. The oxidative stress results confirm the antioxidant power of melatonin to counteract the damaging effects of exposure to environmental contaminants such as glyphosate‐based pesticides. It will then be interesting to further our work to fully understand the sex‐dependent effect of melatonin.