Despite its significant impact on mortality, tuberculosis (TB)-diabetes mellitus (DM) co-prevalence has not been well-elucidated for the cause of death. We investigated the impact of DM on TB-related and non-TB-related deaths in patients with TB. This retrospective nationwide cohort study included patients diagnosed with TB between 2011 and 2017 in South Korea. We performed Fine and Gray regression model analyses to assess the mortality risk of DM classified by cause of death. Of 239,848 patients, 62,435 (26.0%) had DM, and 20,203 died during anti-TB treatment. Of all deaths, 47.9% (9,668) were caused by TB, and the remaining 52.1% (10,535) was attributed to various non-TB-related causes. The mortality rate was higher in the DM than in the non-DM groups in both men and women. DM was associated with a higher risk of TB-related (adjusted hazard ratio [aHR] 1.07, 95% confidence interval [CI] 1.01–1.13) and non-TB-related (aHR 1.21, 95% CI 1.15–1.27) deaths in men; however, only a higher risk of non-TB-related deaths (aHR 1.29, 95% CI 1.20–1.38) in women. Our findings indicate that DM is independently associated with a greater risk of death during anti-TB treatment among patients with TB for both TB-related and non-TB-related deaths.