The founding member of the inhibitor of apoptosis protein (IAP) family was originally identified as a cell death inhibitor. However, recent evidence suggests that IAPs are multifunctional signaling devices that influence diverse biological processes. To investigate the in vivo function of Drosophila melanogaster IAP2, we have generated diap2 null alleles. diap2 mutant animals develop normally and are fully viable, suggesting that diap2 is dispensable for proper development. However, these animals were acutely sensitive to infection by gram-negative bacteria. In Drosophila, infection by gram-negative bacteria triggers the innate immune response by activating the immune deficiency (imd) signaling cascade, a NF-κB-dependent pathway that shares striking similarities with the pathway of mammalian tumor necrosis factor receptor 1 (TNFR1). diap2 mutant flies failed to activate NF-κB-mediated expression of antibacterial peptide genes and, consequently, rapidly succumbed to bacterial infection. Our genetic epistasis analysis places diap2 downstream of or in parallel to imd, Dredd, Tak1, and Relish. Therefore, DIAP2 functions in the host immune response to gram-negative bacteria. In contrast, we find that the Drosophila TNFR-associated factor (Traf) family member Traf2 is dispensable in resistance to gram-negative bacterial infection. Taken together, our genetic data identify DIAP2 as an essential component of the Imd signaling cascade, protecting the organism from infiltrating microbes.