Integration of metabolic and immune responses during animal development ensures energy balance, permitting both growth and defense. Disturbed homeostasis causes organ failure, growth retardation, and metabolic disorders. Here, we show that the Drosophila melanogaster activating transcription factor 3 (Atf3) safeguards metabolic and immune system homeostasis. Loss of Atf3 results in chronic inflammation and starvation responses mounted primarily by the larval gut epithelium, while the fat body suffers lipid overload, causing energy imbalance and death. Hyperactive proinflammatory and stress signaling through NF-κB/Relish, Jun N-terminal kinase, and FOXO in atf3 mutants deregulates genes important for immune defense, digestion, and lipid metabolism. Reducing the dose of either FOXO or Relish normalizes both lipid metabolism and gene expression in atf3 mutants. The function of Atf3 is conserved, as human ATF3 averts some of the Drosophila mutant phenotypes, improving their survival. The single Drosophila Atf3 may incorporate the diversified roles of two related mammalian proteins.