The impact of the COVID-19 pandemic on tuberculosis control in high-burden countries has not been adequately assessed. We aimed to estimate the impact of the COVID-19 pandemic on the national tuberculosis programme in Indonesia, in association with indicators of human development and health-system capacity across all 514 districts in 34 provinces. We did a nationwide longitudinal analysis to compare tuberculosis case notification, treatment coverage, and mortality rates in Indonesia before (2016-19) and during (2020-21) the COVID-19 pandemic. The following outcomes were assessed: the district-level quarterly reported tuberculosis case notification rate (number of all reported tuberculosis cases per 100 000 population), treatment coverage (proportion of tuberculosis patients who started treatment), and all-cause mortality rate in patients with tuberculosis (number of reported deaths per 100 000 population). District-level data on COVID-19 incidence and deaths, health-system capacity, and human development and sociodemographics were also analysed. Multilevel linear spline regression was done to assess quarterly time trends for the three outcomes. During the COVID-19 pandemic, the tuberculosis case notification rate declined by 26% (case notification rate ratio 0·74, 95% CI 0·72-0·77) and treatment coverage declined by 11% (treatment coverage ratio 0·89, 95% CI 0·88-0·90), but there was no significant increase in all-cause mortality (all-cause mortality rate ratio 0·97, 95% CI 0·91-1·04) compared with the pre-pandemic period. In the second year of the pandemic, we observed a partial recovery of the case notification rate from Q1 to Q4 of 2021, a persistent decrease in treatment coverage, and a decrease in the all-cause mortality rate from Q2 of 2020 to Q4 of 2021. The multivariable analysis showed that the reduction in the tuberculosis case notification rate was associated with a higher COVID-19 incidence rate (adjusted odds ratio 3·1, 95% CI 1·1-8·6, for the highest compared with the lowest group) and fewer GeneXpert machines for tuberculosis diagnosis (3·1, 1·0-9·4, for the lowest compared with the highest group) per 100 000 population. The reduction in tuberculosis treatment coverage was associated with higher COVID-19 incidence (adjusted odds ratio 11·7, 95% CI 1·5-93·4, for the highest compared with the lowest group), fewer primary health centres (10·6, 4·1-28·0, for the lowest compared with the middle-high group), and a very low number of doctors (0·3, 0·1-0·9, for the low-middle compared with the lowest group) per 100 000 population. No factors were shown to be significantly associated with all-cause mortality. The COVID-19 pandemic adversely and unevenly affected the national tuberculosis programme across Indonesia, with the greatest impacts observed in districts with the lowest health-system capacity. These disruptions could lead to an escalation in tuberculosis transmission in the coming years, warranting the need for intensified efforts to control tuberculosis and strengthen local health systems. Wellcome Africa Asia Programme Vietnam. For the Bahasa translation of the abstract see Supplementary Materials section.