Commensal bacteria are crucial to maintain immune homeostasis in mucosal tissues and disturbances in their ecology can affect disease susceptibility. Here, we report evidence that commensal bacteria shape the efficiency of immune surveillance in mucosal tissues. Antibiotic-treated (Abt) mice were more susceptible to development of engrafted B16/F10 melanoma and Lewis lung carcinoma, exhibiting a shortened mean survival time with more numerous and larger tumor foci in the lungs. The defective antitumor response of Abt mice was independent of dehydration caused by antibiotics. Host defenses relied upon intact commensal bacteria with no class specificity. Mechanistic investigations revealed a defective induction of the gdT17 cell response in lungs of Abt mice; here, more aggressive tumor development was observed, possibly related to a reduction in IL6 and IL23 expression there. Adding normal gdT cells or supplementing IL17 restored the impaired immune surveillance phenotype in Abt mice. Overall, our results demonstrated the importance of commensal bacteria in supporting the host immune response against cancer, defined an important role for gdT17 responses in the mechanism, and suggested deleterious effects of antibiotic treatment on cancer susceptibility and progression. Cancer Res; 74(15); 4030-41. Ó2014 AACR.