The interaction between the nematode Caenorhabditis elegans and a Gram-positive bacterial pathogen, Microbacterium nematophilum, provides a model for an innate immune response in nematodes. This pathogen adheres to the rectal and post-anal cuticle of the worm, causing slowed growth, constipation, and a defensive swelling response of rectal hypodermal cells. To explore the genomic responses that the worm activates after pathogenic attack we used microarray analysis of transcriptional changes induced after 6-h infection, comparing virulent with avirulent infection. We defined 89 genes with statistically significant expression changes of at least twofold, of which 68 were up-regulated and 21 were down-regulated. Among the former, those encoding C-type lectin domains were the most abundant class. Many of the 89 genes exhibit genomic clustering, and we identified one large cluster of 62 genes, of which most were induced in response to infection. We tested 41 of the induced genes for involvement in immunity using mutants or RNAi, finding that six of these are required for the swelling response and five are required more generally for defense. Our results indicate that C-type lectins and other putative pathogen-recognition molecules are important for innate immune defense in C. elegans. We also found significant induction of genes encoding lysozymes, proteases, and defense-related proteins, as well as various domains of unknown function. The genes induced during infection by M. nematophilum appear largely distinct from genes induced by other pathogens, suggesting that C. elegans mounts pathogen-specific responses to infection.