BACKGROUND: The efficacy and safety of azithromycin in the treatment of COVID-19 remain uncertain. We assessed whether adding azithromycin to standard of care, which included hydroxychloroquine, would improve clinical outcomes of patients admitted to the hospital with severe COVID-19. METHODS: We did an open-label, randomised clinical trial at 57 centres in Brazil. We enrolled patients admitted to hospital with suspected or confirmed COVID-19 and at least one additional severity criteria as follows: use of oxygen supplementation of more than 4 L/min flow; use of high-flow nasal cannula; use of non-invasive mechanical ventilation; or use of invasive mechanical ventilation. Patients were randomly assigned (1:1) to azithromycin (500 mg via oral, nasogastric, or intravenous administration once daily for 10 days) plus standard of care or to standard of care without macrolides. All patients received hydroxychloroquine (400 mg twice daily for 10 days) because that was part of standard of care treatment in Brazil for patients with severe COVID-19. The primary outcome, assessed by an independent adjudication committee masked to treatment allocation, was clinical status at day 15 after randomisation, assessed by a six-point ordinal scale, with levels ranging from 1 to 6 and higher scores indicating a worse condition (with odds ratio [OR] greater than 1.00 favouring the control group). The primary outcome was assessed in all patients in the intention-to-treat (ITT) population who had severe acute respiratory syndrome coronavirus 2 infection confirmed by molecular or serological testing before randomisation (ie, modified ITT [mITT] population). Safety was assessed in all patients according to which treatment they received, regardless of original group assignment. This trial was registered at ClinicalTrials.gov, NCT04321278. FINDINGS: 447 patients were enrolled from March 28 to May 19, 2020. COVID-19 was confirmed in 397 patients who constituted the mITT population, of whom 214 were assigned to the azithromycin group and 183 to the control group. In the mITT population, the primary endpoint was not significantly different between the azithromycin and control groups (OR 1.36 [95% CI 0.94-1.97], p=0.11). Rates of adverse events, including clinically relevant ventricular arrhythmias, resuscitated cardiac arrest, acute kidney failure, and corrected QT interval prolongation, were not significantly different between groups. INTERPRETATION: In patients with severe COVID-19, adding azithromycin to standard of care treatment (which included hydroxychloroquine) did not improve clinical outcomes. Our findings do not support the routine use of azithromycin in combination with hydroxychloroquine in patients with severe COVID-19. FUNDING: COALITION COVID-19 Brazil and EMS.