Hepatitis D virus (HDV) infection increases the risk of hepatocellular carcinoma (HCC) in the natural course of chronic hepatitis B (CHB) patients. Its role in patients treated with nucleotide/nucleoside analogues (NAs) is unclear. We aimed to study the role of hepatitis D in the development of HCC in CHB patients treated with NAs. Altogether, 1349 CHB patients treated with NAs were tested for anti-HDV antibody and RNA. The incidence and risk factors of HCC development were analyzed. Rates of anti-HDV and HDV RNA positivity were 2.3% and 1.0%, respectively. The annual incidence of HCC was 1.4 per 100 person-years after a follow-up period of over 5409.5 person-years. The strongest factor association with HCC development was liver cirrhosis (hazard ratio [HR]/95% confidence interval [CI] 9.98/5.11–19.46, P < 0.001), followed by HDV RNA positivity (HR/ CI 5.73/1.35–24.29, P = 0.02), age > 50 years old (HR/CI 3.64/2.03–6.54, P < 0.001), male gender (HR/CI 2.69/1.29–5.60, P: 0.01), and body mass index (BMI, HR/CI 1.11/1.03–1.18, P = 0.004). The 5-year cumulative incidence of HCC was 7.3% for patients with HDV RNA negativity compared to that of 22.2% for patients with HDV RNA positivity (P = 0.01). In the subgroup of cirrhotic patients, the factors associated with HCC development were HDV RNA positivity (HR/CI 4.45/1.04–19.09, P = 0.04) and BMI (HR/CI 1.11/1.03–1.19, P = 0.01). HDV viremia played a crucial role in HCC development in CHB patients who underwent NA therapy.