Psychosocial factors such as anxiety or optimism may be related to the risk of adverse pregnancy outcomes, but the evidence is conflicting. We investigated the relation between maternal anxiety, optimism, gestational age and infant birth weight in a cohort of 667 nulliparous women from the Prenatal Exposures and Preeclampsia Prevention study, Pittsburgh PA. Women completed the Spielberger Trait Anxiety Inventory and the Life Orientation Test at 18 weeks gestation. Linear and logistic regression models assessed the relation of anxiety and optimism to gestational age, birth weight centile, preterm delivery (<37 weeks) or small for gestational age (<10th percentile) births. After adjustment for age, race, preeclampsia, and smoking, higher anxiety was associated with decreasing gestational age (-1.6 days per SD increase in anxiety score, P = 0.06). This relationship was modified by maternal race (P < 0.01 for interaction). Among African American women, each SD increase in anxiety was associated with gestations that were, on average, 3.7 days shorter (P = 0.03). African American women with anxiety in the highest quartile had gestations that were 8.2 days shorter, and they had increased risk for preterm birth after excluding cases of preeclampsia (OR 1.69, 95% CI 1.08, 2.64). There was no association between anxiety and gestational age among White women. There was also no relation between anxiety, optimism and birth weight centile. Trait anxiety was associated with a reduction in gestational age and increased risk for preterm birth among African American women. Interventions that reduce anxiety among African American pregnant women may improve pregnancy outcomes.