Because fetal brain development proceeds at an extremely rapid pace, early life experiences have the potential to alter the trajectory of neurodevelopment, which may increase susceptibility for developmental and neuropsychiatric disorders. There is evidence that prenatal maternal stress and anxiety, especially worries specifically related to being pregnant, influence neurodevelopmental outcomes. In the current prospective longitudinal study, we included 89 women for whom serial data were available for pregnancy-specific anxiety, state anxiety, and depression at 15, 19, 25, 31, and 37 weeks gestation. When the offspring from the target pregnancy were between 6 and 9 years of age, their executive function was assessed. High levels of mean maternal pregnancy-specific anxiety over the course of gestation were associated with lower inhibitory control in girls only and lower visuospatial working memory performance in boys and girls. Higher-state anxiety and depression also were associated with lower visuospatial working memory performance. However, neither state anxiety nor depression explained any additional variance after accounting for pregnancy-specific anxiety. The findings contribute to the literature supporting an association between pregnancy-specific anxiety and cognitive development and extend our knowledge about the persistence of this effect until middle childhood.