Polyunsaturated fatty acids (PUFAs) form a class of essential micronutrients that play a vital role in development, cardiovascular health, and immunity. The influence of lipids on the immune response is both complex and diverse, with multiple studies pointing to the beneficial effects of long-chain fatty acids in immunity. However, the mechanisms through which PUFAs modulate innate immunity and the effects of PUFA deficiencies on innate immune functions remain to be clarified. Using the Caenorhabditis elegans-Pseudomonas aeruginosa host-pathogen system, we present genetic evidence that a Delta6-desaturase FAT-3, through its two 18-carbon products--gamma-linolenic acid (GLA, 18:3n6) and stearidonic acid (SDA, 18:4n3), but not the 20-carbon PUFAs arachidonic acid (AA, 20:4n6) and eicosapentaenoic acid (EPA, 20:5n3)--is required for basal innate immunity in vivo. Deficiencies in GLA and SDA result in increased susceptibility to bacterial infection, which is associated with reduced basal expression of a number of immune-specific genes--including spp-1, lys-7, and lys-2--that encode antimicrobial peptides. GLA and SDA are required to maintain basal activity of the p38 MAP kinase pathway, which plays important roles in protecting metazoan animals from infections and oxidative stress. Transcriptional and functional analyses of fat-3-regulated genes revealed that fat-3 is required in the intestine to regulate the expression of infection- and stress-response genes, and that distinct sets of genes are specifically required for immune function and oxidative stress response. Our study thus uncovers a mechanism by which these 18-carbon PUFAs affect basal innate immune function and, consequently, the ability of an organism to defend itself against bacterial infections. The conservation of p38 MAP kinase signaling in both stress and immune responses further encourages exploring the function of GLA and SDA in humans.