Abstract Hepatic encephalopathy (HE) is a major complication of cirrhosis, and the management of HE is an important issue. The link between new-onset diabetes and the risk of HE in cirrhotic patients with ascites remains unclear. We aimed to evaluate the risk of HE in cirrhotic patients with new-onset diabetes. The Taiwanese National Health Insurance Research Database comprises records of more than 99% of the entire population. Among randomly sampled one million enrollees, 4503 cirrhotic patients with ascites were enrolled. New-onset diabetes was defined as patients who were given the diagnosis in the years 1999 to 2009 but not in 1997 to 1998. The cohorts of cirrhotic patients with new-onset diabetes (n?=?462) and 1:1 ratio age-, gender-, and inception point (onset date of diabetes)-matched nondiabetes (n?=?462) were followed up from the inception point until development of HE, withdrawal from insurance, or December 2009. The Cox proportional hazard model was used to evaluate HE risk associated with new-onset diabetes in the study cohort. Cumulative incidence curve and Gray's test were used to explore the difference in the risk distribution by considering death a competing risk. Patients with new-onset diabetes had a significantly higher cumulative incidence of HE (P = 0.03) compared to nondiabetes patients. After adjustment for age, gender, comorbidity index, decompensated cirrhosis, obesity, hypertension, hyperlipidemia, sepsis, hepatitis C infection, chronic pancreatitis, lactulose use after HE diagnosis, benzodiazepine/barbiturate, spironolactone, furosemide, potassium-sparing diuretic, and diabetes treatment, diabetes was still an independent predictor for HE (hazard ratio?= 1.920, 95% confidence interval?= 1.135-3.246, P = 0.02). Cirrhotic patients with ascites who develop newly diagnosed diabetes have an increased risk of HE.