Whether patients who have undergone gastrectomy are at a high risk of developing pyogenic liver abscess (PLA) remains debatable. From the inpatient claims records of Taiwan’s National Health Insurance Research Database, we identified 33 834 patients with a history of 2000–2010 and135 336 controls without a history of gastrectomy. The 2cohorts were matched by age, sex, and admission year and followed-up until the end of 2011 for estimating the risk of PLA. Overall, the incidence of PLA was 3.5-fold higher in the gastrectomy cohort than in the control cohort (21.6 vs 5.76 per 10 000 person-y). The adjusted hazard ratio (aHR) for the gastrectomy cohort obtained using the multivariate Cox proportional hazards regression model was 3.08 (95% confidence interval [CI] = 2.60–3.64). An elevated post gastrectomy PLA risk was observed in both men and women. Age-specific data revealed that the aHR for the gastrectomy cohort, compared with the control cohort, was the highest in patients younger than 50 years (aHR = 5.16, 95% CI = 2.96–9.01). An addition analysis showed that the gastrectomy cohort exhibited an elevated PLA risk regardless of whether the patients underwent total or partial gastrectomy. Patients with a history of gastrectomy exhibit a high risk of PLA.