Background Although a preventable and treatable disease, tuberculosis causes more than a million deaths each year. As countries work towards achieving the Sustainable Development Goal (SDG) target to end the tuberculosis epidemic by 2030, robust assessments of the levels and trends of the burden of tuberculosis are crucial to inform policy and programme decision making. We assessed the levels and trends in the fatal and non-fatal burden of tuberculosis by drug resistance and HIV status for 195 countries and territories from 1990 to 2016. Methods We analysed 15 943 site-years of vital registration data, 1710 site-years of verbal autopsy data, 764 site-years of sample-based vital registration data, and 361 site-years of mortality surveillance data to estimate mortality due to tuberculosis using the Cause of Death Ensemble model. We analysed all available data sources, including annual case notifications, prevalence surveys, population-based tuberculin surveys, and estimated tuberculosis cause-specific mortality to generate internally consistent estimates of incidence, prevalence, and mortality using DisMod-MR 2.1, a Bayesian meta-regression tool. We assessed how the burden of tuberculosis differed from the burden predicted by the Socio-demographic Index (SDI), a composite indicator of income per capita, average years of schooling, and total fertility rate. Findings Globally in 2016, among HIV-negative individuals, the number of incident cases of tuberculosis was 9·02 million (95% uncertainty interval [UI] 8·05-10·16) and the number of tuberculosis deaths was 1·21 million (1·16-1·27). Among HIV-positive individuals, the number of incident cases was 1·40 million (1·01-1·89) and the number of tuberculosis deaths was 0·24 million (0·16-0·31). Globally, among HIV-negative individuals the agestandardised incidence of tuberculosis decreased annually at a slower rate (-1·3% [-1·5 to -1·2]) than mortality did (-4·5% [-5·0 to -4·1]) from 2006 to 2016. Among HIV-positive individuals during the same period, the rate of change in annualised age-standardised incidence was -4·0% (-4·5 to -3·7) and mortality was -8·9% (-9·5 to -8·4). Several regions had higher rates of age-standardised incidence and mortality than expected on the basis of their SDI levels in 2016. For drug-susceptible tuberculosis, the highest observed-to-expected ratios were in southern sub-Saharan Africa (13·7 for incidence and 14·9 for mortality), and the lowest ratios were in high-income North America (0·4 for incidence) and Oceania (0·3 for mortality). For multidrug-resistant tuberculosis, eastern Europe had the highest observed-to-expected ratios (67·3 for incidence and 73·0 for mortality), and high-income North America had the lowest ratios (0·4 for incidence and 0·5 for mortality). Interpretation If current trends in tuberculosis incidence continue, few countries are likely to meet the SDG target to end the tuberculosis epidemic by 2030. Progress needs to be accelerated by improving the quality of and access to tuberculosis diagnosis and care, by developing new tools, scaling up interventions to prevent risk factors for tuberculosis, and integrating control programmes for tuberculosis and HIV. Funding Bill & Melinda Gates Foundation.