Nuclear hormone receptors (NHRs) are ligand-gated transcription factors that control adaptive host responses following recognition of specific endogenous or exogenous ligands. Although NHRs have expanded dramatically in C. elegans compared to other metazoans, the biological function of only a few of these genes has been characterized in detail. Here, we demonstrate that an NHR can activate an anti-pathogen transcriptional program. Using genetic epistasis experiments, transcriptome profiling analyses and chromatin immunoprecipitation-sequencing, we show that, in the presence of an immunostimulatory small molecule, NHR-86 binds to the promoters of immune effectors to activate their transcription. NHR-86 is not required for resistance to the bacterial pathogen Pseudomonas aeruginosa at baseline, but activation of NHR-86 by this compound drives a transcriptional program that provides protection against this pathogen. Interestingly, NHR-86 targets immune effectors whose basal regulation requires the canonical p38 MAPK PMK-1 immune pathway. However, NHR-86 functions independently of PMK-1 and modulates the transcription of these infection response genes directly. These findings characterize a new transcriptional regulator in C. elegans that can induce a protective host response towards a bacterial pathogen.