Abstract Background Although smoking is considered the primary cause of chronic obstructive pulmonary disease (COPD), there is a growing realization that there may be important secondary risk factors. Tuberculosis may lead to lung impairment; however, whether residual lung damage results in clinically significant, long-term outcomes, independent of smoking, has not been well studied. We aimed to investigate the association between tuberculosis and the subsequent development of COPD using a large, population-based cohort study. Methods We conducted a longitudinal cohort study within the Chinese Electronic Health Records Research in Yinzhou study between 2009 and 2021. We followed participants free of COPD at the beginning of the study, and investigated whether previous or current tuberculosis was an important risk factor. Tuberculosis was recorded based on the Chinese National Disease Reporting system which includes all diagnosed cases at the city, provincial and national levels. We assessed the relationship between tuberculosis and COPD using multivariable survival models, adjusting for demographic and lifestyle characteristics, education level, comorbidities and use of medications. Results Among 477 046 participants, 198 882 were eligible for inclusion in our analysis. In a multivariable model, pulmonary tuberculosis and all tuberculosis were associated with a 2.57-fold [95% confidence interval (CI), 2.31–2.87)] and 1.67-fold (95% CI, 1.48–1.90) increased COPD risk, respectively. Stronger associations of pulmonary tuberculosis and all tuberculosis with COPD were seen in participants who were elderly, or with lower body mass index or education level (Pinteraction<0.001). People with tuberculosis were at an increased risk of COPD if they were current smokers [adjusted hazard ratio (aHR), 1.40; 95% CI, 1.02–1.93] or non-smokers (aHR, 1.72; 95% CI, 1.50–1.98). Conclusions Persons who developed tuberculosis were at much greater risk of developing COPD, even accounting for smoking and other potential confounders.