More than a quarter of the world's population is infected with nematode parasites, and more than a hundred species of nematodes are parasites of humans [1-3]. Despite extensive morbidity and mortality caused by nematode parasites, the biological mechanisms of host-parasite interactions are poorly understood, largely because of the lack of genetically tractable model systems. We have demonstrated that the insect parasitic nematode Heterorhabditis bacteriophora, its bacterial symbiont Photorhabdus luminescens, and the fruit fly Drosophila melanogaster constitute a tripartite model for nematode parasitism and parasitic infection. We find that infective juveniles (IJs) of Heterorhabditis, which contain Photorhabdus in their gut, can infect and kill Drosophila larvae. We show that infection activates an immune response in Drosophila that results in the temporally dynamic expression of a subset of antimicrobial peptide (AMP) genes, and that this immune response is induced specifically by Photorhabdus. We also investigated the cellular and molecular mechanisms underlying IJ recovery, the developmental process that occurs in parasitic nematodes upon host invasion and that is necessary for successful parasitism. We find that the chemosensory neurons and signaling pathways that control dauer recovery in Caenorhabditis elegans also control IJ recovery in Heterorhabditis, suggesting conservation of these developmental processes across free-living and parasitic nematodes.