Background: The WHO ACTION-I trial demonstrated that dexamethasone significantly reduced neonatal mortality when administered to women at risk of early preterm birth in low-resource countries. We conducted a secondary analysis to determine how these benefits can be optimised, by evaluating the effect of dexamethasone compared to placebo on newborn mortality and severe respiratory distress outcomes at different administration-to-birth intervals, and identifying the interval with the greatest benefits. Methods: The WHO ACTION-I trial was a multi-country, individually-randomised, parallel-group, double-blind, placebo-controlled trial. It was conducted in 29 hospitals across Bangladesh, India, Kenya, Nigeria, and Pakistan. Women with a viable singleton or multiple pregnancy who presented to participating hospitals at a gestational age of 26 weeks 0 days–33 weeks 6 days and who were at risk of imminent preterm birth were eligible. In this secondary analysis, 2638 women and their newborns treated with single course of dexamethasone or placebo were analysed. Multivariate logistic regression was used to assess the effect of dexamethasone versus placebo on neonatal death, stillbirth or neonatal death, and severe respiratory distress at 24 h and at 168 h, by administration-to-birth interval (from 0 through 28 days), adjusting for gestational age at first dose. We used relative risks to identify the administration-to-birth interval with the greatest benefits of dexamethasone compared to placebo on the newborn outcomes. Findings: Between 24 December 2017 and 21 November 2019, 2852 women and their 3070 babies were enrolled in the WHO ACTION-I trial; 1332 women (1464 babies) in the dexamethasone group and 1306 women (1440 babies) in the placebo group were included in this secondary analysis. Neonatal mortality risk was lower with increasing time between initiating dexamethasone and birth, achieving peak mortality reduction by days 13 and 14 and then diminishing as the interval approached 28 days, regardless of gestational age at administration. For other outcomes, the overall pattern of risk reduction extending into the second week was consistent with that of neonatal death. Interpretation: In women at risk of preterm birth prior to 34 weeks’ gestation, the neonatal benefits of antenatal dexamethasone appear to increase with longer administration-to-birth intervals than previously thought. This knowledge can support clinical assessment and estimation of the risks of adverse preterm newborn outcomes at the time of birth, and the potential benefits of antenatal dexamethasone treatment for a known administration-to-birth interval. Funding: Bill and Melinda Gates Foundation; World Health Organization.