Lung squamous cell carcinoma (LUSC) is associated with a worse prognosis than other histological subtypes of non-small cell lung cancer. Due to the vital role of CD8+T cells in anti-tumor immunity, the characterization of CD8+T cell infiltration-related (CTLIR) gene signature in LUSC is worthy of in-depth exploration. In our study, tumor tissues of LUSC patients from Renmin Hospital of Wuhan University were stained by multiplex immunohistochemistry to evaluate the density of infiltrated CD8+T cells and explore the correlation with immunotherapy response. We found that the proportion of LUSC patients who responded to immunotherapy was higher in the high density of CD8+T cell infiltration group than in the low density of CD8+T cell infiltration group. Subsequently, we collected bulk RNA-sequencing data from The Cancer Genome Atlas (TCGA) database. The abundance of infiltrating immune cells in LUSC patients was analyzed by using CIBERSORT algorithm, and weighted correlation network analysis was performed to identify the co-expressed gene modules related to CD8+T cells. We then developed a prognostic gene signature based on CD8+T cell co-expressed genes and calculated the CTLIR risk score, which stratified LUSC patients into high-risk and low-risk groups. With univariate and multivariate analyses, the gene signature was identified as an independent prognostic factor in LUSC patients. The overall survival of LUSC patients in the high-risk group was significantly shorter than that of the low-risk group in the TCGA cohort, which was validated in Gene Expression Omnibus datasets. We analyzed immune cell infiltration in the tumor microenviroment and found fewer CD8+T cells and more regulatory T cell infiltration in the high-risk group, which is characterized as an immunosuppressive phenotype. Furthermore, the LUSC patients in the high-risk group were predicted to have a better response to immunotherapy than those in the low-risk group when treated with PD-1 and CTLA4 inhibitors. In conclusion, we performed a comprehensive molecular analysis of the CTLIR gene signature in LUSC and constructed a risk model for LUSC patients to predict prognosis and immunotherapy response.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12859-023-05302-3.