Background Vitamin D level is inversely associated with tuberculosis (TB) and diabetes (DM). Vitamin D could be a mediator in the association between TB and DM. We examined the associations between vitamin D, TB and DM. Methods Consecutive adults with TB and sex- and age-matched volunteers were included in a case-control study in Dar es Salaam, Tanzania. Glycemia and total vitamin D (25(OH)D) were measured at enrolment and after TB treatment in cases. The association between low 25(OH)D (