Our study demonstrated that the use of DPP-4 inhibitors in T2DM patients with chronic HBV infection can significantly decrease the risk of HCC (aHRs: 0.53, 95% CIs: 0.44–0.65). Here, DPP4 is linked to type 2 diabetes mellitus.