HIV replication leads to a change in lymphocyte phenotypes that impairs immune protection against opportunistic infections. We examined current HIV replication as an independent risk factor for tuberculosis (TB). We included people living with HIV from 25 European cohorts 1983-2015. Individuals <16 years or with previous TB were excluded. Person-time was calculated from enrolment (baseline) to the date of TB diagnosis or last follow-up information. We used adjusted Poisson regression and general additive regression models. We included 272,548 people with a median follow-up of 5.9 years (interquartile range [IQR] 2.3-10.9). At baseline, the median CD4 cell count was 355 cells/μL (IQR 193-540) and the median HIV-RNA level 22,000 copies/mL (IQR 1,300-103,000). During 1,923,441 person-years of follow-up, 5,956 (2.2%) people developed TB. Overall, TB incidence was 3.1 per 1,000 person-years (95% confidence interval [CI] 3.02-3.18) and was four times higher in patients with HIV-RNA levels of 10,000 compared with levels <400 copies/mL in any CD4 stratum. CD4 and HIV-RNA time-updated analyses showed that the association between HIV-RNA and TB incidence was independent of CD4. The TB incidence rate ratio for people born in TB-endemic countries compared with those born in Europe was 1.8 (95% CI 1.5-2.2). Our results indicate that ongoing HIV replication (suboptimal HIV control) is an important risk factor for TB, independent of CD4 count. Those at highest risk of TB are people from TB-endemic countries. Close monitoring and TB preventive therapy for people with suboptimal HIV control is important.