Emerging studies have shed light on the association between Helicobacter pylori (HP) infection and cardiometabolic risk. However, there is no evidence to support a causal link for the relationship in the general population. Our aim was to determine whether HP infection is associated with the risks of incident type II diabetes mellitus (DM) in a population-based cohort consisting of adults from the general population. A total of 69235 adults enrolled in the study obtained health examinations at the Tri-Service General Hospital in Taiwan from 2010 to 2016. HP infection detection was performed by rapid urease tests (RUTs), and endoscopic examinations were used to diagnose gastroesophageal reflux disease (GERD), gastric ulcers (GUs) and duodenal ulcers (DUs). Cross-sectional and longitudinal analyses were performed to examine the association between HP infection and cardiometabolic diseases using logistic regression and Cox regression in a large population-based study. HP infection was significantly associated with the presence of metabolic syndrome (MetS) (OR = 1.26, 95%CI: 1.00-1.57) and DM (OR = 1.59, 95%CI: 1.17-2.17) only in male subjects, and abnormal endoscopic findings were also correlated with cardiometabolic diseases. Our findings demonstrated that participants with HP infection had an elevated risk of developing incident DM (HR = 1.54, 95%CI: 1.11-2.13). In addition, endoscopic findings of a DU (HR = 1.63, 95%CI: 1.02-2.63), rather than GERD or a GU, were also predictive of incident DM. In this cohort, HP infection was a statistically significant predictor of incident DM among male population.