Tumor IL17-producing (IL17A+) cells infiltration has different prognostic values among various cancers. The objective of this study was to assess the effect of IL17A+ cells in gastric cancer. The study included two patient cohorts, the Cancer Genome Atlas cohort (TCGA, n = 351) and the Zhongshan Hospital cohort (ZSHC, n = 458). The TCGA and ZSHC were used for mRNA-related and cells infiltration-related analyses, respectively. The roles of IL17A mRNA and IL17A+ cells in overall survival (OS), response to adjuvant chemotherapy (ACT), and immune contexture were evaluated. Another independent cohort was included to identify the correlation between mRNA of IL17A and IL17A+ cells infiltration (the preliminary Zhongshan Hospital cohort, PZSHC, n = 21). The infiltration of IL17A+ cells was positively correlated with the expression of IL17A mRNA (Spearman's ρ = 0.811; P < 0.001). High IL17A mRNA expression and intratumoral IL17A+ cells were correlated with improved OS and remained to be significant after adjusted for confounders. Patients with TNM II/III disease whose tumor present higher intratumoral IL17A+ cells or lower peritumoral IL17A+ cells can benefit more from ACT. Elevated IL17A mRNA expression and increased intratumoral IL17A+ cells infiltration was associated with more antitumor mast cells and nature killer cells infiltration and less pro-tumor M2 macrophages infiltration. High IL17A mRNA expression represented a Th17 cells signature and immune response process and was correlated with increased cytotoxic GZMA, GZMB, IFNG, PRF1, and TNFSF11 expression. IL17A mRNA expression and intratumoral IL17A+ cells infiltration were correlated with antitumor immune contexture. IL17A+ cells infiltration could be used as an independent prognostic biomarker for OS and predictive biomarker for superior response to ACT, and further prospective validation needs to be conducted.