BACKGROUND: Traffic-related air pollution exposure may influence brain development and function and thus be related to neurobehavioral problems in children, but little is known about windows of susceptibility. AIMS: Examine associations of gestational and childhood exposure to traffic-related pollution with executive function and behavior problems in children. METHODS: We studied associations of pre- and postnatal pollution exposures with neurobehavioral outcomes in 1212 children in the Project Viva pre-birth cohort followed to mid-childhood (median age 7.7years). Parents and classroom teachers completed the Behavior Rating Inventory of Executive Function (BRIEF) and the Strengths and Difficulties Questionnaire (SDQ). Using validated spatiotemporal models, we estimated exposure to black carbon (BC) and fine particulate matter (PM2.5) in the third trimester of pregnancy, from birth to 3years, from birth to 6years, and in the year before behavioral ratings. We also measured residential distance to major roadways and near-residence traffic density at birth and in mid-childhood. We estimated associations of BC, PM2.5, and other traffic exposure measures with BRIEF and SDQ scores, adjusted for potential confounders. RESULTS: Higher childhood BC exposure was associated with higher teacher-rated BRIEF Behavioral Regulation Index (BRI) scores, indicating greater problems: 1.0 points (95% confidence interval (CI): 0.0, 2.1) per interquartile range (IQR) increase in birth-age 6BC, and 1.7 points (95% CI: 0.6, 2.8) for BC in the year prior to behavioral ratings. Mid-childhood residential traffic density was also associated with BRI score (0.6, 95% CI: 0.1, 1.1). Birth-age 3BC was not associated with BRIEF or SDQ scores. Third trimester BC exposure was not associated with teacher-rated BRI scores (-0.2, 95% CI: -1.1, 0.8), and predicted lower scores (fewer problems) on the BRIEF Metacognition Index (-1.2, 95% CI: -2.2, -0.2) and SDQ total difficulties (-0.9, 95% CI: -1.4, -0.4). PM2.5 exposure was associated with teacher-rated BRIEF and SDQ scores in minimally adjusted models but associations attenuated with covariate adjustment. None of the parent-rated outcomes suggested adverse effects of greater pollution exposure at any time point. CONCLUSIONS: Children with higher mid-childhood exposure to BC and greater near-residence traffic density in mid-childhood had greater problems with behavioral regulation as assessed by classroom teachers, but not as assessed by parents. Prenatal and early childhood exposure to traffic-related pollution did not predict greater executive function or behavior problems; third trimester BC was associated with lower scores (representing fewer problems) on measures of metacognition and behavioral problems.