BackgroundTissue-resident memory T (TRM) cells can reside in the tumor microenvironment and are considered the primary response cells to immunotherapy. Heterogeneity in functional status and spatial distribution may contribute to the controversial role of TRM cells but we know little about it.MethodsThrough multiplex immunofluorescence (mIF) (CD8, CD103, PD-1, Tim-3, GZMB, CK), the quantity and spatial location of TRM cell subsets were recognized in the tissue from 274 patients with NSCLC after radical surgery. By integrating multiple machine learning methods, we constructed a TRM-based spatial immune signature (TRM-SIS) to predict the prognosis. Furthermore, we conducted a CD103-related gene set enrichment analysis (GSEA) and verified its finding by another mIF panel (CD8, CD103, CK, CD31, Hif-1α).ResultsThe density of TRM cells was significantly correlated with the expression of PD-1, Tim-3 and GZMB. Four types of TRM cell subsets was defined, including TRM1 (PD-1−Tim-3−TRM), TRM2 (PD-1+Tim-3−TRM), TRM3 (PD-1−Tim-3+TRM) and TRM4 (PD-1+Tim-3+TRM). The cytotoxicity of TRM2 was the strongest while that of TRM4 was the weakest. Compare with TRM1 and TRM2, TRM3 and TRM4 had better infiltration and stronger interaction with cancer cells. The TRM-SIS was an independent prognostic factor for disease-free survival [HR = 2.43, 95%CI (1.63–3.60), P < 0.001] and showed a better performance than the TNM staging system for recurrence prediction. Furthermore, by CD103-related GSEA and mIF validation, we found a negative association between tumor angiogenesis and infiltration of TRM cells.ConclusionsThese findings reveal a significant heterogeneity in the functional status and spatial distribution of TRM cells, and support it as a biomarker for the prognosis of NSCLC patients. Regulating TRM cells by targeting tumor angiogenesis may be a potential strategy to improve current immunotherapy.