Background: Patients with COVID-19 pneumonia can have increased inflammation and elevated cytokines, including interleukin (IL)-6, which might be deleterious. Thus, sarilumab, a high-affinity anti-IL-6 receptor antibody, might improve the outcome of patients with moderate-to-severe COVID-19 pneumonia. Methods: We did a multicentric, open-label, Bayesian randomised, adaptive, phase 2/3 clinical trial, nested within the CORIMUNO-19 cohort, to test a superiority hypothesis. Patients 18 years or older hospitalised with COVID-19 in six French centres, requiring at least 3L/min of oxygen but without ventilation assistance and a WHO Clinical Progression Scale [CPS] score of 5 were enrolled. Patients were randomly assigned (1:1) via a web-based system, according to a randomisation list stratified on centre and with blocks randomly selected among 2 and 4, to receive usual care plus 400 mg of sarilumab intravenously on day 1 and on day 3 if clinically indicated (sarilumab group) or usual care alone (usual care group). Primary outcomes were the proportion of patients with WHO-CPS scores greater than 5 on the 10-point scale on day 4 and survival without invasive or non-invasive ventilation at day 14. This completed trial is closed to new participants and is registered with ClinicalTrials.gov, NCT04324073. Findings: 165 patients were recruited from March 27 to April 6, 2020, and 148 patients were randomised (68 patients to the sarilumab group and 80 to the usual care group) and followed up for 90 days. Median age was 61·7 years [IQR 53·0–71·1] in the sarilumab group and 62·8 years [56·0–71·7] in the usual care group. In the sarilumab group 49 (72%) of 68 were men and in the usual care group 59 (78%) of 76 were men. Four patients in the usual care group withdrew consent and were not analysed. 18 (26%) of 68 patients in the sarilumab group had a WHO-CPS score greater than 5 at day 4 versus 20 (26%) of 76 in the usual care group (median posterior absolute risk difference 0·2%; 90% credible interval [CrI] −11·7 to 12·2), with a posterior probability of absolute risk difference greater than 0 of 48·9%. At day 14, 25 (37%) patients in the sarilumab and 26 (34%) patients in the usual care group needed ventilation or died, (median posterior hazard ratio [HR] 1·10; 90% CrI 0·69–1·74) with a posterior probability HR greater than 1 of 37·4%. Serious adverse events occurred in 27 (40%) patients in the sarilumab group and 28 (37%) patients in the usual care group (p=0·73). Interpretation: Sarilumab treatment did not improve early outcomes in patients with moderate-to-severe COVID-19 pneumonia. Further studies are warranted to evaluate the effect of sarilumab on long-term survival.