Type 2 diabetes mellitus (T2DM) is increasingly known as a risk factor of hepatocellular carcinoma (HCC). In this study, we determined the risk factors associated with HCC in T2DM patients. This was a matched case-control study conducted at two hepatobiliary referral centres in a developing country. Patients’ sociodemographic, clinical, and biochemical characteristics between 1 January 2012 and 30 June 2018 were extracted from the electronic medical records and analysed using multivariate logistic regression analysis. A total of 212 case-control pairs were included. Significant risk factors included Chinese and Malay ethnicities that interacted with viral hepatitis (adjusted odds ratio [AOR] = 11.77, 95% confidence interval [CI]: 1.39–99.79) and (AOR = 37.94, 95% CI: 3.92–367.61) respectively, weight loss (AOR = 5.28, 95% CI: 2.29–12.19), abdominal pain/ discomfort (AOR = 6.73, 95% CI: 3.34–13.34), alcohol (AOR = 4.08, 95% CI: 1.81–9.22), fatty liver (AOR = 3.29, 95% CI: 1.40–7.76), low platelet (AOR = 4.03, 95% CI:1.90–8.55), raised alanine transaminase (AOR = 2.11, 95% CI: 1.16–3.86). and alkaline phosphatase (ALP) levels (AOR = 2.17, 95% CI: 1.17–4.00). Statins reduced the risk of HCC by 63% (AOR = 0.37, 95% CI: 0.21–0.65). The identification of these factors aids the risk stratification for HCC among T2DM patients for early detection and decision-making in patient management in the primary care setting.