In the US, infants born to non-Hispanic Black birthing parents are 50% more likely to be born preterm than those born to non-Hispanic White birthing parents, and individual-level factors do not fully account for this inequity. Neighborhood context, rooted in historic patterns of structural racism, may facilitate understanding patterns of inequity in preterm birth. To estimate the association between neighborhood opportunity level, measured by the Child Opportunity Index (COI), and preterm birth among infants in Massachusetts. In this cross-sectional, population-based study, Massachusetts birth certificates from 3 large metropolitan areas (Boston, Springfield, and Worcester) were linked to US Census tract-level data from the COI, and log binomial regression models and generalized estimating equations were fit to examine associations of different levels of opportunity with preterm birth. Singleton infants born in Massachusetts between February 1, 2011, and December 31, 2015, were included. Analyses were originally conducted in 2019 and updated in 2024. Level of child opportunity (measured by the COI) at the US Census tract level. Race and ethnicity were ascertained from the birth certificate, as reported by the birthing parent. Live birth before 37 completed weeks' gestation. The analytic dataset included 267 553 infants, of whom 18.9% were born to Hispanic, 10.1% to non-Hispanic Asian or Pacific Islander, 10.1% to non-Hispanic Black, and 61.0% to non-Hispanic White birthing parents. More than half of infants born to non-Hispanic Black and Hispanic birthing parents were born into very low opportunity neighborhoods, and in crude models, this was associated with greater prevalence of preterm birth relative to very high opportunity neighborhoods (prevalence ratio, 1.44; 95% CI, 1.37-1.52). After adjustment for covariates, infants born into very low opportunity neighborhoods still had a greater prevalence of preterm birth (prevalence ratio, 1.16; 95% CI, 1.10-1.23). In this cross-sectional study of neighborhood opportunity and preterm birth, elevated risk associated with exposure to a very low opportunity neighborhood, coupled with the disproportionate exposure by race and ethnicity, points to a modifiable factor that may contribute to racial and ethnic inequities in preterm birth. Future research should investigate interventions that seek to address neighborhood opportunity.