Background: Gastrectomy has been indicated as a risk factor for laryngeal cancer, and possibly also for pharyngeal cancer, but few studies are available. The postulated mechanism is increased bile reflux following gastrectomy. Methods: This was a population-based cohort study of patients who underwent gastrectomy for peptic ulcer disease between 1964 and 2008 in Sweden. Follow-up data for cancer was obtained from the Swedish Cancer Register. Relative risk was calculated as standardised incidence ratios (SIRs) with 95% confidence intervals (CIs). Results: The gastrectomy cohort comprises 19 767 patients, contributing 348 231 person-years at risk. The observed number of patients with laryngeal (n=56) and pharyngeal cancer (n=28) was two-fold higher than the expected (SIR: 2.0, 95% CI: 1.5–2.6 and SIR: 2.4, 95% CI: 1.6–3.5, respectively). After exclusion of 5536 cohort members with tobacco- or alcohol-related disease, the point SIRs remained increased (SIR: 1.6, 95% CI: 1.1–2.2 and SIR: 1.7, 95% CI: 0.9–2.8, respectively). The SIRs of laryngeal and pharyngeal cancer increased with time after gastrectomy (P for trend <0.0001), and were particularly increased ⩾30 years after gastrectomy (SIR: 4.8, 95% CI: 2.1–9.5 and SIR: 10.2, 95% CI: 3.7–22.3, respectively). Conclusion: Gastrectomy for peptic ulcer disease might entail a long-term increased risk of laryngeal and pharyngeal cancer.