Background: Antenatal corticosteroids given to women before preterm birth improve infant survival and health. However, whether dexamethasone or betamethasone have better maternal, neonatal, and childhood health outcomes remains unclear. We therefore aimed to assess whether administration of antenatal dexamethasone to women at risk of preterm birth reduced the risk of death or neurosensory disability in their children at age 2 years compared with betamethasone. We also aimed to assess whether dexamethasone reduced neonatal morbidity, had benefits for the mother, or affected childhood body size, blood pressure, behaviour, or general health compared with betamethasone. Methods: In this multicentre, double-blind, randomised controlled trial, we recruited pregnant women from 14 maternity hospitals in Australia and New Zealand that could provide care to preterm babies. Women were eligible for study inclusion if they were at risk of preterm birth before 34 weeks of gestation, had a singleton or twin pregnancy, and had no contraindications to antenatal corticosteroids. We randomly assigned women (1:1) to receive two intramuscular injections of either 12 mg dexamethasone (dexamethasone sodium phosphate) or 11·4 mg betamethasone (Celestone Chronodose), 24 h apart. The randomisation schedule used balanced, variable blocks that were stratified by hospital, gestational age, and number of fetuses (singleton or twins). We masked all participants, staff, and assessors to treatment groups. Analyses were by intention to treat. The primary outcome was death or neurosensory disability at age 2 years (corrected for prematurity). This study is registered with ANZCTR, ACTRN12608000631303. Findings: Between Jan 28, 2009, and Feb 1, 2013, we randomly assigned 1346 (78%) women who were pregnant with 1509 fetuses to groups: 679 (50%) women were assigned to receive dexamethasone and 667 (50%) women were assigned to receive betamethasone. 27 (4%) fetuses, infants, or children in the dexamethasone group and 28 (4%) fetuses, infants, or children in the betamethasone group died before age 2 years. The primary outcome of death or neurosensory disability at age 2 years was determined for 603 (79%) of 763 fetuses whose mothers received dexamethasone and 591 (79%) of 746 fetuses whose mothers received betamethasone. We found a similar incidence of death or neurosensory disability in the dexamethasone (198 [33%] of 603 infants) and betamethasone groups (192 [32%] of 591 infants; adjusted relative risk [adjRR] 0·97, 95% CI 0·83 to 1·13; p=0·66). 18 (3%) of 679 women in the dexamethasone group and 28 of 667 (4%) women in the betamethasone group reported side-effects. Discomfort at the injection site, the most frequent side-effect, was less likely in the dexamethasone group than in the betamethasone group (six [1%] women vs 17 [3%] women; p=0·02). Interpretation: The incidence of survival without neurosensory disability at age 2 years did not differ between dexamethasone and betamethasone treatment. Our findings indicate that either antenatal corticosteroid can be given to women before preterm birth to improve infant and child health. Funding: National Health and Medical Research Council (Australia).