Exposure to adversity during the perinatal period has been associated with cognitive difficulties in children. Given the role of the nucleus accumbens (NAcc) in attention and impulsivity, we examined whether NAcc volume at age six mediates the relations between pre- and postnatal adversity and subsequent attention problems in offspring. 306 pregnant women were recruited as part of the Growing Up in Singapore Towards Healthy Outcomes Study. Psychosocial stress was assessed during pregnancy and across the first 5 years postpartum. At six years of age, children underwent structural MRI and, at age seven years, mothers reported on their children’s attention problems. Separate factor analyses conducted on measures of pre- and postnatal adversity each yielded two latent factors: maternal mental health and socioeconomic status. Both pre- and postnatal maternal mental health predicted children’s attention difficulties. Further, NAcc volume mediated the relation between prenatal, but not postnatal, maternal mental health and children’s attention problems. These findings suggest that the NAcc is particularly vulnerable to prenatal maternal mental health challenges and contributes to offspring attention problems. Characterizing the temporal sensitivity of neurobiological structures to adversity will help to elucidate mechanisms linking environmental exposures and behavior, facilitating the development of neuroscience-informed interventions for childhood difficulties.