Background: Pembrolizumab is active in head and neck squamous cell carcinoma (HNSCC), with programmed cell death ligand 1 (PD-L1) expression associated with improved response. Methods: KEYNOTE-048 was a randomised, phase 3 study of participants with untreated locally incurable recurrent or metastatic HNSCC done at 200 sites in 37 countries. Participants were stratified by PD-L1 expression, p16 status, and performance status and randomly allocated (1:1:1) to pembrolizumab alone, pembrolizumab plus a platinum and 5-fluorouracil (pembrolizumab with chemotherapy), or cetuximab plus a platinum and 5-fluorouracil (cetuximab with chemotherapy). Investigators and participants were aware of treatment assignment. Investigators, participants, and representatives of the sponsor were masked to the PD-L1 combined positive score (CPS) results; PD-L1 positivity was not required for study entry. The primary endpoints were overall survival (time from randomisation to death from any cause) and progression-free survival (time from randomisation to radiographically confirmed disease progression or death from any cause, whichever came first) in the intention-to-treat population (all participants randomly allocated to a treatment group). There were 14 primary hypotheses: superiority of pembrolizumab alone and of pembrolizumab with chemotherapy versus cetuximab with chemotherapy for overall survival and progression-free survival in the PD-L1 CPS of 20 or more, CPS of 1 or more, and total populations and non-inferiority (non-inferiority margin: 1·2) of pembrolizumab alone and pembrolizumab with chemotherapy versus cetuximab with chemotherapy for overall survival in the total population. The definitive findings for each hypothesis were obtained when statistical testing was completed for that hypothesis; this occurred at the second interim analysis for 11 hypotheses and at final analysis for three hypotheses. Safety was assessed in the as-treated population (all participants who received at least one dose of allocated treatment). This study is registered at ClinicalTrials.gov, number NCT02358031. Findings: Between April 20, 2015, and Jan 17, 2017, 882 participants were allocated to receive pembrolizumab alone (n=301), pembrolizumab with chemotherapy (n=281), or cetuximab with chemotherapy (n=300); of these, 754 (85%) had CPS of 1 or more and 381 (43%) had CPS of 20 or more. At the second interim analysis, pembrolizumab alone improved overall survival versus cetuximab with chemotherapy in the CPS of 20 or more population (median 14·9 months vs 10·7 months, hazard ratio [HR] 0·61 [95% CI 0·45–0·83], p=0·0007) and CPS of 1 or more population (12·3 vs 10·3, 0·78 [0·64–0·96], p=0·0086) and was non-inferior in the total population (11·6 vs 10·7, 0·85 [0·71–1·03]). Pembrolizumab with chemotherapy improved overall survival versus cetuximab with chemotherapy in the total population (13·0 months vs 10·7 months, HR 0·77 [95% CI 0·63–0·93], p=0·0034) at the second interim analysis and in the CPS of 20 or more population (14·7 vs 11·0, 0·60 [0·45–0·82], p=0·0004) and CPS of 1 or more population (13·6 vs 10·4, 0·65 [0·53–0·80], p<0·0001) at final analysis. Neither pembrolizumab alone nor pembrolizumab with chemotherapy improved progression-free survival at the second interim analysis. At final analysis, grade 3 or worse all-cause adverse events occurred in 164 (55%) of 300 treated participants in the pembrolizumab alone group, 235 (85%) of 276 in the pembrolizumab with chemotherapy group, and 239 (83%) of 287 in the cetuximab with chemotherapy group. Adverse events led to death in 25 (8%) participants in the pembrolizumab alone group, 32 (12%) in the pembrolizumab with chemotherapy group, and 28 (10%) in the cetuximab with chemotherapy group. Interpretation: Based on the observed efficacy and safety, pembrolizumab plus platinum and 5-fluorouracil is an appropriate first-line treatment for recurrent or metastatic HNSCC and pembrolizumab monotherapy is an appropriate first-line treatment for PD-L1-positive recurrent or metastatic HNSCC. Funding: Merck Sharp & Dohme.