Innate immune responses are evolutionarily conserved processes that provide crucial protection against invading organisms. Gene activation by potent NF-κB transcription factors is essential both in mammals and Drosophila during infection and stress challenges. If not strictly controlled, this potent defense system can activate autoimmune and inflammatory stress reactions, with deleterious consequences for the organism. Negative regulation to prevent gene activation in healthy organisms, in the presence of the commensal gut flora, is however not well understood.We show that the Drosophila homolog of mammalian Oct1/POU2F1 transcription factor, called Nubbin (Nub), is a repressor of NF-κB/Relish-driven antimicrobial peptide gene expression in flies. In nub1 mutants, which lack Nub-PD protein, excessive expression of antimicrobial peptide genes occurs in the absence of infection, leading to a significant reduction of the numbers of cultivatable gut commensal bacteria. This aberrant immune gene expression was effectively blocked by expression of Nub from a transgene. We have identified an upstream regulatory region, containing a cluster of octamer sites, which is required for repression of antimicrobial peptide gene expression in healthy flies. Chromatin immunoprecipitation experiments demonstrated that Nub binds to octamer-containing promoter fragments of several immune genes. Gene expression profiling revealed that Drosophila Nub negatively regulates many genes that are involved in immune and stress responses, while it is a positive regulator of genes involved in differentiation and metabolism.This study demonstrates that a large number of genes that are activated by NF-κB/Relish in response to infection are normally repressed by the evolutionarily conserved Oct/POU transcription factor Nub. This prevents uncontrolled gene activation and supports the existence of a normal gut flora. We suggest that Nub protein plays an ancient role, shared with mammalian Oct/POU transcription factors, to moderate responses to immune challenge, thereby increasing the tolerance to biotic stress.