The presence of type 2 diabetes mellitus (DM) in patients with cirrhosis is associated with an increased risk of spontaneous bacterial peritonitis (SBP) which may represent an increased susceptibility to infections. Endocan is a key player in the regulation of inflammatory disorders, and a biomarker in bacteremia and sepsis. To investigate the association between both endocan and DM, and developing SBP, we conducted a retrospective cohort study. Three hundred and thirty patients (179 men, 151 women; mean age 61.0 ± 8.5 years) who were treated for liver cirrhosis were studied between January 2007 and December 2016. Univariate and multivariate analyses using age, type 2 diabetes mellitus, severity of cirrhosis (Child-Pugh or MELD score), platelet count, serum proinflammatory cytokines, procalcitonin, C-reactive protein, and endocan level were conducted to identify factors related to the development of SBP. Among 330 patients with the median follow-up of 6.0 years, the cumulative incidence of SBP at 5 years was 28.6%. On multivariate analysis, a high serum endocan level and DM were independent and significant risk factors for SBP development (hazard ratio (HR) 1.634 (95% CI: 1.012 - 2.638; P = 0.047) and 2.482 (95% CI: 1.134 - 5.412; P = 0.023), respectively). Furthermore, the cumulative incidence rate of SBP in cirrhotic patients with high endocan levels was significantly greater than that in patients with low endocan levels (P = 0.035; log-rank test). Endocan is an independent predictor of SBP development in patients with cirrhosis. Cirrhotic patients with type 2 diabetes mellitus who have a higher endocan levels should be monitored carefully for the development of spontaneous bacterial peritonitis.