IMPORTANCE Although opioids are used to treat neonatal abstinence syndrome (NAS), the best pharmacologic treatment has not been established. OBJECTIVE To compare the safety and efficacy of methadone and morphine in NAS. DESIGN, SETTING, AND PARTICIPANTS In this randomized, double-blind, intention-to-treat trial, term infants from 8 US newborn units whose mothers received buprenorphine, methadone, or opioids for pain control during pregnancy were eligible. A total of 117 infants were randomized to receive methadone or morphine from February 9, 2014, to March 6, 2017. Mothers who declined randomization could consent to data collection and standard institutional treatment. INTERVENTIONS Infants were assessed with the Finnegan Neonatal Abstinence Scoring System every 4 hours and treated with methadone or placebo every 4 hours or morphine every 4 hours. Infants with persistently elevated Finnegan scores received dose increases. Infants who exceeded a predetermined opioid dose received phenobarbital. Dose reductions occurred every 12 to 48 hours when signs of NAS were controlled with therapy, stopping at 20% of the original dose. MAIN OUTCOMES AND MEASURES The primary end point was length of hospital stay (LOS). The secondary end points were LOS attributable to NAS and length of drug treatment (LOT). RESULTS A total of 183 mothers consented to have their infants in the study; 117 infants required treatment. Because 1 parent withdrew consent, data were analyzed on 116 infants (mean [SD] gestational age, 39.1 [1.1] weeks; mean [SD] birth weight, 3157 [486] g; 58 [50%] male). Demographic variables and risk factors were similar except for more prenatal cigarette exposure in infants who received methadone. Adjusting for study site and maternal opioid type, methadone was associated with decreased mean number of days for LOS by 14%