Many extremely preterm infants (born before 28 gestational weeks [GWs]) develop cognitive impairment in later life, although the underlying pathogenesis is not yet completely understood. Our examinations of the developing human neocortex confirmed that neuronal migration continues beyond 23 GWs, the gestational week at which extremely preterm infants have live births. We observed larger numbers of ectopic neurons in the white matter of the neocortex in human extremely preterm infants with brain injury and hypothesized that altered neuronal migration may be associated with cognitive impairment in later life. To confirm whether preterm brain injury affects neuronal migration, we produced brain damage in mouse embryos by occluding the maternal uterine arteries. The mice showed delayed neuronal migration, ectopic neurons in the white matter, altered neuronal alignment, and abnormal corticocortical axonal wiring. Similar to human extremely preterm infants with brain injury, the surviving mice exhibited cognitive deficits. Activation of the affected medial prefrontal cortices of the surviving mice improved working memory deficits, indicating that decreased neuronal activity caused the cognitive deficits. These findings suggest that altered neuronal migration altered by brain injury might contribute to the subsequent development of cognitive impairment in extremely preterm infants.