BACKGROUND: Whether metformin may reduce hepatocellular carcinoma (HCC) risk requires confirmation. METHODS: Type 2 diabetes patients newly diagnosed during 1999-2005 and with 2 or more prescriptions of antidiabetic drugs were enrolled from the Taiwan's National Health Insurance database. A total of 173 917 ever-users and 21 900 never-users of metformin were identified (unmatched cohort). A 1:1 matched-pair cohort of 21 900 ever-users and 21 900 never-users based on a propensity score (PS) was created. Hazard ratios were estimated by Cox regression incorporated with the inverse probability of treatment weighting using the PS. In addition, interactions with aspirin and statin were evaluated. RESULTS: In the unmatched cohort, 619 never-users and 2642 ever-users developed HCC, with a respective incidence of 668.0 and 330.7 per 100 000 person-years and an overall hazard ratio of 0.49 (95% confidence interval: 0.45-0.54). The hazard ratios for the first (<25.7 months), second (25.7-56.9 months) and third (>56.9 months) tertile of cumulative duration of metformin therapy were 0.89 (0.81-0.98), 0.50 (0.46-0.56) and 0.23 (0.21-0.26) respectively. Analyses of the matched cohort showed an overall hazard ratio of 0.76 (0.67-0.85), and the hazard ratios for the respective tertiles were 1.39 (1.19-1.62), 0.77 (0.65-0.91) and 0.37 (0.30-0.45). Aspirin and statin were observed to have a significant interaction with metformin. CONCLUSIONS: Metformin was associated with a reduced risk of HCC in a dose-response pattern. Users of both metformin and aspirin or metformin and statin had the lowest risk.