Tumor necrosis factor (TNF) constitutes a critical host defense against tuberculosis, but its excess is also implicated in tuberculosis pathogenesis in zebrafish and humans. Using the zebrafish, we elucidate the pathways by which TNF mediates tuberculosis pathogenesis. TNF excess induces mitochondrial reactive oxygen species (ROS) in infected macrophages through RIP1-RIP3-dependent pathways. While initially increasing macrophage microbicidal activity, ROS rapidly induce programmed necrosis (necroptosis) and release mycobacteria into the growth-permissive extracellular milieu. TNF-induced necroptosis occurs through two pathways: modulation of mitochondrial cyclophilin D, implicated in mitochondrial permeability transition pore formation, and acid sphingomyelinase-mediated ceramide production. Combined genetic blockade of cyclophilin D and acid sphingomyelinase renders the high TNF state hyperresistant by preventing macrophage necrosis while preserving increased microbicidal activity. Similarly, the cyclophilin D-inhibiting drug alisporivir and the acid sphingomyelinase-inactivating drug, desipramine, synergize to reverse susceptibility, suggesting the therapeutic potential of these orally active drugs against tuberculosis and possibly other TNF-mediated diseases.