210 Background: Tissue-resident memory T cells (TRM) are a specialized subset of long-lived memory T cells that reside in peripheral tissues. However, the impact of TRM-related immunosurveillance on the tumor-immune microenvironment (TIME) and tumor progression across various non-small-cell lung cancer (NSCLC) patient populations is yet to be elucidated. Methods: Our comprehensive analysis of multiple independent single-cell and bulk RNA-seq datasets of patient NSCLC samples generated reliable, unique TRM signatures, through which we inferred the abundance of TRM in NSCLC. A machine learning model was developed to prognosticate survival, tested in multiple independent NSCLC cohorts. Model performance was corroborated through Kaplan-Meier survival plots, receiver operating characteristic (ROC) curves, principal component analysis, and t-SNE analyses. Results: We discovered that TRM abundance is consistently positively correlated with CD4+ T helper 1 cells, M1 macrophages, and resting dendritic cells in the TIME. In addition, TRM signatures are strongly associated with immune checkpoint genes and the prognosis of NSCLC patients. A TRM-based machine learning model to predict patient survival was validated and an 18-gene risk score was further developed to effectively stratify patients into low-risk and high-risk categories, wherein patients with high-risk scores had significantly lower overall survival than patients with low-risk. The prognostic value of the risk score was independently validated by the TCGA dataset and multiple independent NSCLC patient datasets. Notably, low-risk NSCLC patients with higher TRM infiltration exhibited enhanced T-cell immunity, nature killer cell activation, and other TIME immune responses related pathways, indicating a more active immune profile benefitting from immunotherapy. However, the TRM signature revealed low TRM abundance and a lack of prognostic association among lung squamous cell carcinoma patients in contrast to adenocarcinoma, indicating that the two NSCLC subtypes are driven by distinct TIMEs. Conclusions: Altogether, this study provides valuable insights into the complex interactions between TRM and TIME and their impact on NSCLC patient prognosis. The development of a simplified 18-gene risk score provides a practical prognostic marker for risk stratification. Keywords: Tissue resident memory T cell, non-small-cell lung cancer, prognosis, tumor immune microenvironment, machine learning.