Tumor necrosis factor (TNF, TNFalpha) is implicated in various pathophysiological processes and can be either protective, as in host defense, or deleterious, as in autoimmunity or toxic shock. To uncover the in vivo functions of TNF produced by different cell types, we generated mice with TNF ablation targeted to various leukocyte subsets. Systemic TNF in response to lipopolysaccharide was produced mainly by macrophages and neutrophils. This source of TNF was indispensable for resistance to an intracellular pathogen, Listeria, whereas T-cell-derived TNF was important for protection against high bacterial load. Additionally, both T-cell-derived TNF and macrophage-derived TNF had critical and nonredundant functions in the promotion of autoimmune hepatitis. Our data suggest that T-cell-specific TNF ablation may provide a therapeutic advantage over systemic blockade.