First-line therapy for advanced oesophageal cancer is currently limited to fluoropyrimidine plus platinum-based chemotherapy. We aimed to evaluate the antitumour activity of pembrolizumab plus chemotherapy versus chemotherapy alone as first-line treatment in advanced oesophageal cancer and Siewert type 1 gastro-oesophageal junction cancer. We did a randomised, placebo-controlled, double-blind, phase 3 study across 168 medical centres in 26 countries. Patients aged 18 years or older with previously untreated, histologically or cytologically confirmed, locally advanced, unresectable or metastatic oesophageal cancer or Siewert type 1 gastro-oesophageal junction cancer (regardless of PD-L1 status), measurable disease per Response Evaluation Criteria in Solid Tumors version 1.1, and Eastern Cooperative Oncology Group performance status of 0-1, were randomly assigned (1:1) to intravenous pembrolizumab 200 mg or placebo, plus 5-fluorouracil and cisplatin (chemotherapy), once every 3 weeks for up to 35 cycles. Randomisation was stratified by geographical region, histology, and performance status. Patients, investigators, and site staff were masked to group assignment and PD-L1 biomarker status. Primary endpoints were overall survival in patients with oesophageal squamous cell carcinoma and PD-L1 combined positive score (CPS) of 10 or more, and overall survival and progression-free survival in patients with oesophageal squamous cell carcinoma, PD-L1 CPS of 10 or more, and in all randomised patients. This trial is registered with ClinicalTrials.gov, NCT03189719, and is closed to recruitment. Between July 25, 2017, and June 3, 2019, 1020 patients were screened and 749 were enrolled and randomly assigned to pembrolizumab plus chemotherapy (n=373 [50%]) or placebo plus chemotherapy (n=376 [50%]). At the first interim analysis (median follow-up of 22·6 months), pembrolizumab plus chemotherapy was superior to placebo plus chemotherapy for overall survival in patients with oesophageal squamous cell carcinoma and PD-L1 CPS of 10 or more (median 13·9 months vs 8·8 months; hazard ratio 0·57 [95% CI 0·43-0·75]; p<0·0001), oesophageal squamous cell carcinoma (12·6 months vs 9·8 months; 0·72 [0·60-0·88]; p=0·0006), PD-L1 CPS of 10 or more (13·5 months vs 9·4 months; 0·62 [0·49-0·78]; p<0·0001), and in all randomised patients (12·4 months vs 9·8 months; 0·73 [0·62-0·86]; p<0·0001). Pembrolizumab plus chemotherapy was superior to placebo plus chemotherapy for progression-free survival in patients with oesophageal squamous cell carcinoma (6·3 months vs 5·8 months; 0·65 [0·54-0·78]; p<0·0001), PD-L1 CPS of 10 or more (7·5 months vs 5·5 months; 0·51 [0·41-0·65]; p<0·0001), and in all randomised patients (6·3 months vs 5·8 months; 0·65 [0·55-0·76]; p<0·0001). Treatment-related adverse events of grade 3 or higher occurred in 266 (72%) patients in the pembrolizumab plus chemotherapy group versus 250 (68%) in the placebo plus chemotherapy group. Compared with placebo plus chemotherapy, pembrolizumab plus chemotherapy improved overall survival in patients with previously untreated, advanced oesophageal squamous cell carcinoma and PD-L1 CPS of 10 or more, and overall survival and progression-free survival in patients with oesophageal squamous cell carcinoma, PD-L1 CPS of 10 or more, and in all randomised patients regardless of histology, and had a manageable safety profile in the total as-treated population. Merck Sharp & Dohme.