Objective: To estimate the effectiveness of antiretroviral treatment (ART) in preventing tuberculosis (TB) in HIV-infected people during the first six years of ART programme expansion. Design: Cohort study comparing TB risk without ART and after ART initiation. Setting Public sector HIV programme of the Free State province, South Africa Subjects 74,074 HIV infected people enrolled from 2004 until 2010, of whom 43,898 received ART and 30,176 did not. Intervention Combination antiretroviral treatment. Main outcome measures Time to first TB diagnosis, adjusted for CD4 cell count, weight, age, sex, previous TB, district and year, with ART, CD4 and weight as time varying covariates and with death as a competing risk. Results: 3858 first TB episodes occurred during 78,202 person-years at risk with ART and 5669 episodes occurred during 62,801 person-years without ART (incidence rates 4.9 and 9.0 per 100 person years, crude incidence rate ratio 0.55 (95% confidence interval 0.52-0.57)). The adjusted sub-hazard ratio (SHR) of time to first TB episode after starting ART, compared to follow-up without ART, was 0.67 (0.64-0.70). Within CD4 subgroups (<50, 50-199, 100-199, 200-349 and >350 cells/µL) the respective SHRs were 0.64 (0.57-0.71), 0.63 (0.57-0.70), 0.66 (0.61-0.72), 0.67 (0.62-0.72), 0.72 (0.63-0.83), and 0.97 (0.60-1.59). Adjusted SHRs for ART decreased with each year of enrollment, from 0.90 (0.77-1.04) in 2004 to 0.54 (0.43-0.67) in 2010. Conclusions ART was effective in preventing TB in HIV infected patients with CD4 counts below 350 cells/µL, but less so than previously estimated. Effectiveness increased each year.