Vagus nerve may play a role in serum glucose modulation. The complicated peptic ulcer patients (with perforation or/and bleeding) who received surgical procedures with or without vagotomy provided 2 patient populations for studying the impact of vagus nerve integrity. We assessed the risk of developing type 2 diabetes in peptic ulcer patients without and with complications by surgical treatment received in a retrospective population study using the National Health Insurance database in Taiwan.A cohort of 163,385 patients with peptic ulcer and without Helicobacter pylori infection in 2000 to 2003 was established. A randomly selected cohort of 163,385 persons without peptic ulcer matched by age, sex, hypertension, hyperlipidemia, Charlson comorbidity index score, and index year was utilized for comparison. The risks of developing diabetes in both cohorts and in the complicated peptic ulcer patients who received truncal vagotomy or simple suture/hemostasis (SSH) were assessed at the end of 2011.The overall diabetes incidence was higher in patients with peptic ulcer than those without peptic ulcer (15.87 vs 12.60 per 1000 person-years) by an adjusted hazard ratio (aHR) of 1.43 (95% confidence interval [CI] = 1.40–1.47) based on the multivariable Cox proportional hazards regression analysis (competing risk). Comparing ulcer patients with truncal vagotomy and SSH or those without surgical treatment, the aHR was the lowest in the vagotomy group (0.48, 95% CI = 0.41–0.56).Peptic ulcer patients have an elevated risk of developing type 2 diabetes. Moreover, there were associations of vagus nerve severance and decreased risk of subsequent type 2 diabetes in complicated peptic ulcer patients.