Salmonella typhimurium causes a localized enteric infection in immunocompetent individuals, whereas HIV-infected individuals develop a life-threatening bacteremia. Here we show that simian immunodeficiency virus (SIV) infection results in depletion of T helper type 17 (TH17) cells in the ileal mucosa of rhesus macaques, thereby impairing mucosal barrier functions to S. typhimurium dissemination. In SIV-negative macaques, the gene expression profile induced by S. typhimurium in ligated ileal loops was dominated by TH17 responses, including the expression of interleukin-17 (IL-17) and IL-22. TH17 cells were markedly depleted in SIV-infected rhesus macaques, resulting in blunted TH17 responses to S. typhimurium infection and increased bacterial dissemination. IL-17 receptor-deficient mice showed increased systemic dissemination of S. typhimurium from the gut, suggesting that IL-17 deficiency causes defects in mucosal barrier function. We conclude that SIV infection impairs the IL-17 axis, an arm of the mucosal immune response preventing systemic microbial dissemination from the gastrointestinal tract.