Thyroid cancer (TC) is a common and curable endocrine tumor occurring in the head and neck characterized by a low mortality rate compared to other malignancies. In this study, the immune mi-croenvironment of TC was investigated to identify biomarkers. The mRNA and clinical data available in this study were accessed from The Cancer Genome Atlas-Thyroid Cancer (TCGA-THCA) dataset. Differences in immune infiltration levels of TC and normal samples were assessed by CIBERSORT. Thyroid cancer samples were classified into high-and low-abundance groups according to the median abundance of immune cell infiltration, and CD8+ T cells were notably correlated with the survival status. Differential expression analysis was conducted on CD8+ T cells to obtain immune-related differentially expressed genes (DEGs). Subsequently, a prognostic risk model was established through Cox regression analysis. According to the median risk score, samples in the training set and validation set were assigned to high-and low-risk groups. The survival and ROC curves demonstrated that the model possesses fa-vorable prognostic prediction ability. Furthermore, the results of gene set enrichment analysis (GSEA) indicated differences between the high-and low-risk groups in terms of ECM receptor interaction and transforming growth factor (3 (TGF-(3) signaling pathways. The tumor microenvironment of TC samples was evaluated by ESTIMATE, which showed that stromal scores were higher in the high-risk group. Finally, simple-sample GSEA (ssGSEA) was performed on TC samples. The results indicated a higher infiltration level of NK cells in the low-risk group, as well as a lower level in the high-risk group. In terms of immune function-related gene sets, genes related to APC co-inhibition, cytolytic activity, HLA and T cell co-inhibition were observed to present higher expression levels in the low-risk group. In general, this study built a 6-gene prognostic risk assessment model based on CD8+ T cells through bioinformatics analysis, which is expected to be a reference for clinicians to judge the prognosis of TC patients.