BACKGROUND: Infant pain has immediate and long-term effects but is undertreated because of a paucity of evidence-based analgesics. Although morphine is often used to sedate ventilated infants, its analgesic efficacy is unclear. We aimed to establish whether oral morphine could provide effective and safe analgesia in non-ventilated premature infants for acute procedural pain. METHODS: In this single-centre masked trial, 31 infants at the John Radcliffe Hospital, Oxford, UK, were randomly allocated using a web-based facility with a minimisation algorithm to either 100 μg/kg oral morphine sulphate or placebo 1 h before a clinically required heel lance and retinopathy of prematurity screening examination, on the same occasion. Eligible infants were born prematurely at less than 32 weeks' gestation or with a birthweight lower than 1501 g and had a gestational age of 34-42 weeks at the time of the study. The co-primary outcome measures were the Premature Infant Pain Profile-Revised (PIPP-R) score after retinopathy of prematurity screening and the magnitude of noxious-evoked brain activity after heel lancing. Secondary outcome measures assessed physiological stability and safety. This trial is registered with the European Clinical Trials Database (number 2014-003237-25). FINDINGS: Between Oct 30, 2016, and Nov 17, 2017, 15 infants were randomly allocated to morphine and 16 to placebo; one infant assigned placebo was withdrawn from the study before monitoring began. The predefined stopping boundary was crossed, and trial recruitment stopped because of profound respiratory adverse effects of morphine without suggestion of analgesic efficacy. None of the co-primary outcome measures differed significantly between groups. PIPP-R score after retinopathy of prematurity screening was mean 11·1 (SD 3·2) with morphine and 10·5 (3·4) with placebo (mean difference 0·5, 95% CI -2·0 to 3·0; p=0·66). Noxious-evoked brain activity after heel lancing was median 0·99 (IQR 0·40-1·56) with morphine and 0·75 (0·33-1·22) with placebo (median difference 0·25, 95% CI -0·16 to 0·80; p=0·25). INTERPRETATION: Administration of oral morphine (100 μg/kg) to non-ventilated premature infants has the potential for harm without analgesic efficacy. We do not recommend oral morphine for retinopathy of prematurity screening and strongly advise caution if considering its use for other acute painful procedures in non-ventilated premature infants. FUNDING: Wellcome Trust and National Institute for Health Research.