Background: We aimed to evaluate the use of baricitinib, a Janus kinase (JAK) 1–2 inhibitor, for the treatment of patients admitted to hospital with COVID-19. Methods: This randomised, controlled, open-label, platform trial (Randomised Evaluation of COVID-19 Therapy [RECOVERY]), is assessing multiple possible treatments in patients hospitalised with COVID-19 in the UK. Eligible and consenting patients were randomly allocated (1:1) to either usual standard of care alone (usual care group) or usual care plus baricitinib 4 mg once daily by mouth for 10 days or until discharge if sooner (baricitinib group). The primary outcome was 28-day mortality assessed in the intention-to-treat population. A meta-analysis was done, which included the results from the RECOVERY trial and all previous randomised controlled trials of baricitinib or other JAK inhibitor in patients hospitalised with COVID-19. The RECOVERY trial is registered with ISRCTN (50189673) and ClinicalTrials.gov (NCT04381936) and is ongoing. Findings: Between Feb 2 and Dec 29, 2021, from 10 852 enrolled, 8156 patients were randomly allocated to receive usual care plus baricitinib versus usual care alone. At randomisation, 95% of patients were receiving corticosteroids and 23% were receiving tocilizumab (with planned use within the next 24 h recorded for a further 9%). Overall, 514 (12%) of 4148 patients allocated to baricitinib versus 546 (14%) of 4008 patients allocated to usual care died within 28 days (age-adjusted rate ratio 0·87; 95% CI 0·77–0·99; p=0·028). This 13% proportional reduction in mortality was somewhat smaller than that seen in a meta-analysis of eight previous trials of a JAK inhibitor (involving 3732 patients and 425 deaths), in which allocation to a JAK inhibitor was associated with a 43% proportional reduction in mortality (rate ratio 0·57; 95% CI 0·45–0·72). Including the results from RECOVERY in an updated meta-analysis of all nine completed trials (involving 11 888 randomly assigned patients and 1485 deaths) allocation to baricitinib or another JAK inhibitor was associated with a 20% proportional reduction in mortality (rate ratio 0·80; 95% CI 0·72–0·89; p<0·0001). In RECOVERY, there was no significant excess in death or infection due to non-COVID-19 causes and no significant excess of thrombosis, or other safety outcomes. Interpretation: In patients hospitalised with COVID-19, baricitinib significantly reduced the risk of death but the size of benefit was somewhat smaller than that suggested by previous trials. The total randomised evidence to date suggests that JAK inhibitors (chiefly baricitinib) reduce mortality in patients hospitalised for COVID-19 by about one-fifth. Funding: UK Research and Innovation (Medical Research Council) and National Institute of Health Research.