Cryptosporidium is a leading cause of diarrheal-related deaths in children, especially in resource-poor settings. It also targets the immunocompromised, chronically infecting people living with HIV and primary immunodeficiencies. There is no vaccine or effective treatment. Although it is known from human cases and animal models that CD4+ T cells play a role in curbing Cryptosporidium, the role of CD8+ T cells remains to be defined. Using a Cryptosporidium tyzzeri mouse model, we show that gut-resident CD8+ intraepithelial lymphocytes (IELs) confer resistance to parasite growth. CD8+ IELs express and depend on the ligand-dependent transcription factor aryl hydrocarbon receptor (AHR). AHR deficiency reduces CD8+ IELs, decreases their cytotoxicity, and worsens infection. Transfer of CD8+ IELs rescues severely immunodeficient mice from death following Cryptosporidium challenge. Finally, dietary supplementation of the AHR pro-ligand indole-3-carbinol in newborn mice promotes resistance to infection. Therefore, common dietary metabolites augment the host immune response to cryptosporidiosis, protecting against disease.