Background: Cystic fibrosis transmembrane conductance regulator (CFTR) modulators correct the basic defect caused by CFTR mutations. Improvements in health outcomes have been achieved with the combination of a CFTR corrector and potentiator in people with cystic fibrosis homozygous for the F508del mutation. The addition of elexacaftor (VX-445), a next-generation CFTR corrector, to tezacaftor plus ivacaftor further improved F508del-CFTR function and clinical outcomes in a phase 2 study in people with cystic fibrosis homozygous for the F508del mutation. Methods: This phase 3, multicentre, randomised, double-blind, active-controlled trial of elexacaftor in combination with tezacaftor plus ivacaftor was done at 44 sites in four countries. Eligible participants were those with cystic fibrosis homozygous for the F508del mutation, aged 12 years or older with stable disease, and with a percentage predicted forced expiratory volume in 1 s (ppFEV1) of 40–90%, inclusive. After a 4-week tezacaftor plus ivacaftor run-in period, participants were randomly assigned (1:1) to 4 weeks of elexacaftor 200 mg orally once daily plus tezacaftor 100 mg orally once daily plus ivacaftor 150 mg orally every 12 h versus tezacaftor 100 mg orally once daily plus ivacaftor 150 mg orally every 12 h alone. The primary outcome was the absolute change from baseline (measured at the end of the tezacaftor plus ivacaftor run-in) in ppFEV1 at week 4. Key secondary outcomes were absolute change in sweat chloride and Cystic Fibrosis Questionnaire-Revised respiratory domain (CFQ-R RD) score. This study is registered with ClinicalTrials.gov, NCT03525548. Findings: Between Aug 3 and Dec 28, 2018, 113 participants were enrolled. Following the run-in, 107 participants were randomly assigned (55 in the elexacaftor plus tezacaftor plus ivacaftor group and 52 in the tezacaftor plus ivacaftor group) and completed the 4-week treatment period. The elexacaftor plus tezacaftor plus ivacaftor group had improvements in the primary outcome of ppFEV1 (least squares mean [LSM] treatment difference of 10·0 percentage points [95% CI 7·4 to 12·6], p<0·0001) and the key secondary outcomes of sweat chloride concentration (LSM treatment difference −45·1 mmol/L [95% CI −50·1 to −40·1], p<0·0001), and CFQ-R RD score (LSM treatment difference 17·4 points [95% CI 11·8 to 23·0], p<0·0001) compared with the tezacaftor plus ivacaftor group. The triple combination regimen was well tolerated, with no discontinuations. Most adverse events were mild or moderate; serious adverse events occurred in two (4%) participants receiving elexacaftor plus tezacaftor plus ivacaftor and in one (2%) receiving tezacaftor plus ivacaftor. Interpretation: Elexacaftor plus tezacaftor plus ivacaftor provided clinically robust benefit compared with tezacaftor plus ivacaftor alone, with a favourable safety profile, and shows the potential to lead to transformative improvements in the lives of people with cystic fibrosis who are homozygous for the F508del mutation. Funding: Vertex Pharmaceuticals.