The proinflammatory cytokine interleukin 17 (IL-17) is considered to play a crucial role in diverse human tumors; however, its role in disease progression remains controversial. This study investigated the cellular source and distribution of IL-17 in esophageal squamous cell carcinoma (ESCC) in situ and determined its prognostic value. Immunohistochemistry, immunofluorescence and immunoelectron microscopy were used to identify IL-17-expressing cells in ESCC tissues, paying particular attention to their anatomic localization. Kaplan-Meier analysis and Cox proportional hazards regression models were applied to estimate overall survival in 215 ESCC patients with long-term follow-up (>10 years). The results showed that mast cells, but not T cells or macrophages, were the predominant cell type expressing IL-17 in ESCC tissues. Unexpectedly, these IL-17(+) cells were highly enriched in the muscularis propria rather than the corresponding tumor nest (p < 0.0001). The density of IL-17(+) cells in muscularis propria was inversely associated with tumor invasion (p = 0.016) and served as an independent predictor of favorable survival (p = 0.007). Moreover, the levels of IL-17(+) cells in muscularis propria were positively associated with the density of effector CD8(+) T cells and activated macrophages in the same area (both p < 0.0001). This finding suggested that mast cells may play a significant role in tumor immunity by releasing IL-17 at a previously unappreciated location, the muscularis propria, in ESCC tissues, which could serve as a potential prognostic marker and a novel therapeutic target for ESCC.