ABSTRACT: Background: Layilin (LAYN) is a critical gene that regulates T cell function. However, the correlations of LAYN to prognosis and tumor-infiltrating lymphocytes in different cancers remain unclear. Methods: LAYN expression was analyzed via the Oncomine database and Tumor Immune Estimation Resource (TIMER) site. We evaluated the influence of LAYN on clinical prognosis using Kaplan-Meier plotter, the PrognoScan database and Gene Expression Profiling Interactive Analysis (GEPIA). The correlations between LAYN and cancer immune infiltrates was investigated via TIMER. In addition, correlations between LAYN expression and gene marker sets of immune infiltrates were analyzed by TIMER and GEPIA. Results: A cohort (GSE17536) of colorectal cancer patients showed that high LAYN expression was associated with poorer overall survival (OS), disease-specific survival (DSS), and disease-free survival (DFS). In addition, high LAYN expression was significantly correlated with poor OS and progression-free survival (PFS) in gastric cancers (OS HR = 1.97, P = 3.6e-10; PFS HR = 2.12, P = 2.3e-10). Moreover, LAYN significantly impacts the prognosis of diverse cancers via The Cancer Genome Atlas (TCGA). Specifically, high LAYN expression was correlated with worse OS and PFS in stage 2 to 4 but not stage 1 and stage N0 gastric cancer patients (P = 0.28, 0.34; P = 0.073, 0.092). LAYN expression was positively correlated with infiltrating levels of CD4+ T and CD8+ T cells, macrophages, neutrophils, and dendritic cells (DCs) in colon adenocarcinoma (COAD) and stomach adenocarcinoma (STAD). LAYN expression showed strong correlations with diverse immune marker sets in COAD and STAD. Conclusions: These findings suggest that LAYN is correlated with prognosis and immune infiltrating levels of, including those of CD8+ T cells, CD4+ T cells, macrophages, neutrophils, and DCs in multiple cancers, especially in colon and gastric cancer patients. In addition, LAYN expression potentially contributes to regulation of tumor-associated macrophages (TAMs), DCs, T cell exhaustion and Tregs in colon and gastric cancer. These findings suggest that LAYN can be used as a prognostic biomarker for determining prognosis and immune infiltration in gastric and colon cancers.