Relationship on new statin use and the risk of hepatocellular carcinoma (HCC) in patients with incident type 2 diabetes mellitus (T2DM), who might be at the risk of developing HCC, is uncertained. A nationwide population-based nested case-control study was conducted within the National Health Insurance Service National Sample Cohort 2002-2013 in Korea. Newly prescribed statin after newly diagnosed T2DM was defined as statin use. Controls were matched to case patients on age, sex, follow-up time, and the date of diabetes diagnosis at a five-to-one ratio. Odds ratios (ORs) for associations of statin use with HCC were calculated using conditional logistic regression. After at least a 5-year HCC-free period, there were 229 incident HCC cases and 1,145 matched controls from 47,738 patients with incident diabetes. Of these 229 incident HCC cases, 27 (11.8%) were statin users, whereas 378 (33.0%) were statin users among 1,145 controls. Statin use was associated with a reduced risk of HCC development (adjusted OR [AOR]= 0.36, 95% confidence interval [CI] 0.22-0.60) after adjustment for chronic viral hepatitis, liver cirrhosis, alcoholic liver disease, previous cancer, aspirin use, insulin use, sulfonylurea use, metformin use, thiazolidinedione use, history of chronic obstructive pulmonary disease, Charlson comorbidity score, household income level, and residential area. Risk reduction was accentuated with an increase of cumulative defined daily doses (cDDD) compared with non-users (AORs 0.53, 0.36, 0.32, and 0.26 in ≤60, 60-180, 181-365, and >365cDDD, respectively; P for trend <0.0001). The risk reduction was apparent in the presence of liver disease (AOR = 0.27, 95% CI 0.14-0.50), including heterogeneous groups of clinical diagnosis of liver disease, but not significant in the absence of liver disease (AOR = 0.64, 95% CI 0.32-1.29). Among patients with new onset T2DM, statin use before HCC diagnosis may have a beneficial inhibitory effect on HCC development in a dose-dependent manner, especially in individuals with liver disease.