Thiazolidinediones (TZDs) improve glycaemic control, and ameliorate liver steatosis, inflammation, and fibrosis in patients with fatty liver disease. We aimed to study the impact of TZD and glycaemic control on the risk of hepatocellular carcinoma (HCC) and hepatic events in diabetic patients with chronic hepatitis B (CHB).We performed a retrospective cohort study on diabetic patients with CHBin 2000-2017using a territory-wide electronic healthcare database in Hong Kong. Diabetes mellitus was identified by use of any anti-diabetic medication, haemoglobin A (HbA ) ≥6.5%, fasting glucose ≥7mmol/L in two measurements or ≥11.1mmol/L in one measurement, and/or diagnosis codes.Use of anti-diabetic medications were modelled as time-dependent covariates. Of 28,999diabetic patients with CHB,3,963 (13.7%) developed liver-related events (a composite endpoint of HCC and hepatic events)at a median (interquartile range) follow-up of 7.1 (3.7-11.8) years; 1,153 patients received TZD during follow-up. After adjusted for important confounders, TZD use was associated with a reduced risk of liver-related events(adjusted hazard ratio [aHR] 0.46, 95% CI 0.24-0.88; P=0.019). Similar trends were observed in HCC (aHR 0.57) and hepatic events (aHR 0.35) separately.Compared to HbA of 6.5% at baseline, patients with HbA ≥7% had anincreased risk of liver-related events; the risk further increased in 5,795 (20.0%) patients with HbA ≥9% at baseline (aHR 1.14, 95% CI 1.04-1.26; P=0.006). TZD use is associated with a lower risk of liver-related events in diabetic patients with CHB. Liver-related events are more common in patients with high HbA levels.This article is protected by copyright. All rights reserved.