Background: PD-1 inhibitors combined with chemotherapy have shown efficacy in gastric or gastro-esophageal junction cancer. We compared the efficacy and safety of pembrolizumab plus chemotherapy with placebo plus chemotherapy in participants with locally advanced or metastatic HER2-negative gastric or gastro-esophageal junction adenocarcinoma. Methods: KEYNOTE-859 is a multicentre, double-blind, placebo-controlled, randomised, phase 3 trial, done at 207 medical centres across 33 countries. Eligible participants were aged 18 years and older with previously untreated histologically or cytologically confirmed locally advanced or metastatic HER2-negative gastric or gastro-esophageal junction adenocarcinoma and an Eastern Cooperative Oncology Group performance status of 0 or 1. Patients were randomly assigned (1:1) to receive pembrolizumab or placebo 200 mg, administered intravenously every 3 weeks for up to 35 cycles. All participants received investigator's choice of fluorouracil (intravenous, 800 mg/m2 per day) administered continuously on days 1–5 of each 3-week cycle plus cisplatin (intravenous, 80 mg/m2) administered on day 1 of each 3-week cycle or capecitabine (oral, 1000 mg/m2) administered twice daily on days 1–14 of each 3-week cycle plus oxaliplatin (intravenous, 130 mg/m2) administered on day 1 of each 3-week cycle. Randomisation was done using a central interactive voice-response system and stratified by geographical region, PD-L1 status, and chemotherapy in permuted block sizes of four. The primary endpoint was overall survival, assessed in the intention-to-treat (ITT) population, and the populations with a PD-L1 combined positive score (CPS) of 1 or higher, and PD-L1 CPS of 10 or higher. Safety was assessed in the as-treated population, which included all randomly assigned participants who received at least one dose of study intervention. Here, we report the results of the interim analysis. This study is registered with ClinicalTrials.gov, NCT03675737, and recruitment is complete. Findings: Between Nov 8, 2018, and June 11, 2021, 1579 (66%) of 2409 screened participants were randomly assigned to receive pembrolizumab plus chemotherapy (pembrolizumab group; n=790) or placebo plus chemotherapy (placebo group; n=789). Most participants were male (527 [67%] of 790 participants in the pembrolizumab plus chemotherapy group; 544 [69%] of 789 participants in the placebo plus chemotherapy group) and White (426 [54%]; 435 [55%]). Median follow-up at the data cutoff was 31·0 months (IQR 23·0–38·3). Median overall survival was longer in the pembrolizumab group than in the placebo group in the ITT population (12·9 months [95% CI 11·9–14·0] vs 11·5 months [10·6–12·1]; hazard ratio [HR] 0·78 [95% CI 0·70–0·87]; p<0·0001), in participants with a PD-L1 CPS of 1 or higher (13·0 months [11·6–14·2] vs 11·4 months [10·5–12·0]; 0·74 [0·65–0·84]; p<0·0001), and in participants with a PD-L1 CPS of 10 or higher (15·7 months [13·8–19·3] vs 11·8 months [10·3–12·7]; 0·65 [0·53–0·79]; p<0·0001). The most common grade 3–5 adverse events of any cause were anaemia (95 [12%] of 785 participants in the pembrolizumab group vs 76 [10%] of 787 participants in the placebo group) and decreased neutrophil count (77 [10%] vs 64 [8%]). Serious treatment-related adverse events occurred in 184 (23%) participants in the pembrolizumab group and 146 (19%) participants in the placebo group. Treatment-related deaths occurred in eight (1%) participants in the pembrolizumab group and 16 (2%) participants in the placebo group. No new safety signals were identified. Interpretation: Participants in the pembrolizumab plus chemotherapy group had a significant and clinically meaningful improvement in overall survival with manageable toxicity compared with participants in the placebo plus chemotherapy group. Therefore, pembrolizumab with chemotherapy might be a first-line treatment option for patients with locally advanced or metastatic HER2-negative gastric or gastro-esophageal junction adenocarcinoma. Funding: Merck Sharp and Dohme.