Intra-testicular infection with Listeria monocytogenes was more severe and resulted in increased lethality of γδ T cell- or IL-17-deficient mice, indicating that testicular IL-17 producing γδ T cells are critical for limiting local bacterial infection. Here, IL17A is linked to bacterial infectious disease.