Combining programmed cell death 1 (PD-1) and human epidermal receptor 2 (HER2) targeting agents has shown synergy in HER2-positive preclinical cancer models. Here, we describe a single-arm multi-institutional phase Ib/II trial combining pembrolizumab, trastuzumab, and chemotherapy (capecitabine plus cisplatin) as first-line therapy for HER2-positive advanced gastric cancer (AGC). With a median follow-up of 18.2 months, 3 out of 43 enrolled patients remained in the treatment and 7 finished 2-year treatment without progression. Objective response rate was 76.7% (complete response 16.3%, partial response 60.5%, conversion surgery 4.6%), with 26 patients (56.6%) showing tumor reduction of more than 50%. Median progression-free survival was 8.6 months (95% confidence interval [CI] 7.2–16.4) and median overall survival was 19.3 months (95% CI 16.5–not reached). There was no patient with microsatellite instability-high or Epstein–Barr virus-positive tumor. No patient discontinued pembrolizumab because of immune-related adverse events. Programmed death ligand-1 (PD-L1) status, metastatic organ, or baseline tumor burden were not related to survival. Molecular analyses of pre-treatment tumor samples using next-generation panel sequencing (NGS) showed that HER2 amplification, RTK/RAS pathway alteration, and neoantigen load corrected by HLA-B were related to survival. Comparison analyses of sequentially biopsied samples identified sensitive and resistant sub-clones with spatial and longitudinal tumor heterogeneity. This study provided insight into potentially relevant NGS-based genomic changes to identify patients who may benefit from quadruplet regimen (pembrolizumab, trastuzumab, capecitabine, and cisplatin), which was active and safe for HER2-positive AGC.