Vitamin D (VD) has been extensively associated with the resistance against tuberculosis (TB); however, the mechanism underlying the reduction in TB susceptibility by VD remains uncertain. In our prior investigation, we discovered the relationship between VD and mycobacterium tuberculosis (M.tb)-induced aberrant osteoclastogenesis. Here we report that VD diminishes apoptosis in M.tb-infected THP-1 cells through tumor necrosis factor (TNF) signaling pathway. This novel perspective contributes to the elucidation of the intricate relationship between VD and tuberculosis. In this study, THP-1 cells were infected with the H37Rv strain for 4h at a MOI of 10 and then treated with 1,25-dihydroxy vitamin D (1,25(OH)2D3) (10− 6, 10− 8, 10− 10M) for 1d and 4d respectively. RNA sequencing (RNA-seq) was performed, and differential expression analysis was conducted by the R package edgeR. Immunofluorescence (IF) and immunohistochemistry (IHC) techniques were employed for VDR, TNFR1 and TUNEL in TB patients and serum levels of TNF-α and IL6 were measured simultaneously. Furthermore, the utilization of western blot and qRT-PCR techniques was employed to investigate the impact of VD on pivotal molecules involved in the TNF signaling pathway. In addition, Bacillus Calmette-Guérin (BCG) and VD were administrated by tail vein and articular cavity injection in vivo. Our findings revealed a robust responsiveness of the TNF signaling pathway to M.tb-induced inflammation, resulting in elevated expression of TNF-α, IL-6, and severe apoptosis. VD exhibited significant inhibitory effect on M.tb-induced inflammation and apoptosis both in vitro and in vivo. This study provides new ideas for vitamin D in the study of tuberculous bone destruction.