Pancreatic cancer (PC) is a fetal disease, which is characterized by early metastasis and immune evasion of tumor microenvironment (TME). The current study was designed to identify the potential biomarkers related to metastasis and CD8 + T infiltration in PC. Weighted Gene Co-expression Network Analysis (WGCNA) and protein interaction network were utilized in conjunction with DEGs of PC sourced from TCGA and GEO databases to identify hub genes. The role of YWHAG (tyrosine 3-monooxygenase/tryptophan 5-monooxygenase activation protein gamma) in immune infiltration and cancer metastasis was verified using single-cell sequencing data (GSE154778) of PC. We elucidated the biological effect of YWHAG on PC cells by conducting functional assays. The grey module of WGCNA was presented to be a hub signature. The high level of YWHAG in metastatic cancers was associated with a high degree of T cell infiltration compared with primary tumors. YWHAG was confirmed to be an independent predictor for prognosis. Furthermore, YWHAG silence suppressed cell malignant behavior. When co-cultured with T cells, YWHAG knockdown resulted in an increase in the secretion of TNF-α and a decrease in the secretion of IL-10. Enrichment analysis indicated that YWHAG was involved in focal adhesion and Wnt signaling pathway, which were confirmed by western blotting. In this study, we explored biomarkers associated with metastasis and immune escape, and YWHAG was identified as a key regulator for PC. YWHAG facilitated malignant progression in PC and might be a promising target for immunotherapy by affecting CD8 + T cells infiltration.