Background: Rezafungin is a next-generation, once-a-week echinocandin in development for the treatment of candidaemia and invasive candidiasis and for the prevention of invasive fungal disease caused by Candida, Aspergillus, and Pneumocystis spp after blood and marrow transplantation. We aimed to compare the efficacy and safety of intravenous rezafungin versus intravenous caspofungin in patients with candidaemia and invasive candidiasis. Methods: ReSTORE was a multicentre, double-blind, double-dummy, randomised phase 3 trial done at 66 tertiary care centres in 15 countries. Adults (≥18 years) with systemic signs and mycological confirmation of candidaemia or invasive candidiasis were eligible for inclusion and randomly assigned (1:1) to receive intravenous rezafungin once a week (400 mg in week 1, followed by 200 mg weekly, for a total of two to four doses) or intravenous caspofungin (70 mg loading dose on day 1, followed by 50 mg daily) for no more than 4 weeks. The primary endpoints were global cure (consisting of clinical cure, radiological cure, and mycological eradication) at day 14 for the European Medical Agency (EMA) and 30-day all-cause mortality for the US Food and Drug Administration (FDA), both with a target non-inferiority margin of 20%, assessed in the modified intention-to-treat population (all patients who received one or more doses of study drug and had documented Candida infection based on a culture from blood or another normally sterile site obtained within 96 h before randomisation). Safety was evaluated by the incidence and type of adverse events and deaths in the safety population, defined as all patients who received any amount of study drug. The trial is registered with ClinicalTrials.gov, NCT03667690, and is complete. Findings: Between Oct 12, 2018, and Aug 29, 2021, 222 patients were screened for inclusion, and 199 patients (118 [59%] men; 81 [41%] women; mean age 61 years [SD 15·2]) were randomly assigned (100 [50%] patients to the rezafungin group and 99 [50%] patients to the caspofungin group). 55 (59%) of 93 patients in the rezafungin group and 57 (61%) of 94 patients in the caspofungin group had a global cure at day 14 (weighted treatment difference −1·1% [95% CI −14·9 to 12·7]; EMA primary endpoint). 22 (24%) of 93 patients in the rezafungin group and 20 (21%) of 94 patients in the caspofungin group died or had an unknown survival status at day 30 (treatment difference 2·4% [95% CI −9·7 to 14·4]; FDA primary endpoint). In the safety analysis, 89 (91%) of 98 patients in the rezafungin group and 83 (85%) of 98 patients in the caspofungin group had at least one treatment-emergent adverse event. The most common treatment-emergent adverse events that occurred in at least 5% of patients in either group were pyrexia, hypokalaemia, pneumonia, septic shock, and anaemia. 55 (56%) patients in the rezafungin group and 52 (53%) patients in the caspofungin group had serious adverse events. Interpretation: Our data show that rezafungin was non-inferior to caspofungin for the primary endpoints of day-14 global cure (EMA) and 30-day all-cause mortality (FDA). Efficacy in the initial days of treatment warrants evaluation. There were no concerning trends in treatment-emergent or serious adverse events. These phase 3 results show the efficacy and safety of rezafungin and support its ongoing development. Funding: Cidara Therapeutics and Mundipharma.