Metazoans tolerate commensal-gut microbiota by suppressing immune activation while maintaining the ability to launch rapid and balanced immune reactions to pathogenic bacteria. Little is known about the mechanisms underlying the establishment of this threshold. We report that a recently identified Drosophila immune regulator, which we call PGRP-LC-interacting inhibitor of Imd signaling (PIMS), is required to suppress the Imd innate immune signaling pathway in response to commensal bacteria. pims expression is Imd (immune deficiency) dependent, and its basal expression relies on the presence of commensal flora. In the absence of PIMS, resident bacteria trigger constitutive expression of antimicrobial peptide genes (AMPs). Moreover, pims mutants hyperactivate AMPs upon infection with Gram-negative bacteria. PIMS interacts with the peptidoglycan recognition protein (PGRP-LC), causing its depletion from the plasma membrane and shutdown of Imd signaling. Therefore, PIMS is required to establish immune tolerance to commensal bacteria and to maintain a balanced Imd response following exposure to bacterial infections.