Perinatal brain injuries often result in irreversible learning disabilities, which manifest in early childhood. These injuries are chiefly ascribable to marked susceptibility of the immature brain to glutamate-induced excitotoxicity. No treatments are available. One well-characterized model of perinatal brain injuries consists in injecting the glutamate analog ibotenate into the brain of 5-day-old mice. The resulting excitotoxic lesions resemble the hypoxic–ischemic gray-matter lesions seen in full-term and near-term newborns, as well as the white-matter lesions of preterm newborns. We previously reported that these lesions disrupted odor preference conditioning in newborn mice. The aim of this study was to assess the effectiveness of the neuroprotector melatonin in preventing learning disabilities in newborn mice with ibotenate-induced brain injury. In postnatal day (P) 6–P7 pups, we tested psychomotor reflexes, spontaneous preference for maternal odors as an index of memory, ultrasonic vocalization responses to stroking as an index of sensitivity to tactile stimuli, and conditioned preference for an odor previously paired with stroking as an index of learning abilities. Without melatonin, conditioning was abolished, whereas spontaneous odor preference, psychomotor reflexes, and sensitivity to tactile stimuli were normal. Thus, abolition of conditioning was not associated with sensorimotor impairments. Histological analysis confirmed the efficacy of melatonin in reducing white-matter lesions induced by ibotenate. Furthermore, treatment with melatonin protected the ability to develop conditioning. Thus, melatonin, which easily crosses the blood–brain barrier and has been proven safe in children, may be effective in preventing learning disabilities caused by perinatal brain injuries in human preterm infants.