ABSTRACT: Female breast cancer (BCa) is the most commonly occurring cancer worldwide. The tumor microenvironment (TME) plays an essential role in tumor invasion, angiogenesis, unlimited proliferation, and even immune escape, but we know little about the TME of BCa. In this study, we aimed to find a TME-related biomarker for BCa, especially for invasive breast carcinoma (BRCA), that could predict prognosis and immunotherapy efficacy. Based on RNA-seq transcriptome data and the clinical characteristics of 1222 samples (113 normal and 1109 tumor samples) from The Cancer Genome Atlas (TCGA) database, we used the ESTIMATE algorithm to calculate the ImmuneScore and StromalScore and then identified differentially expressed genes (DEGs) between the high and low ImmuneScore groups and the high and low StromalScore groups. Thereafter, a protein-protein interaction (PPI) network analysis and univariate Cox regression analyses of overall survival were used to identify potential key genes. Five candidate genes were identified, comprising CD2, CCL19, CD52, CD3E, and ITK. Thereafter, we focused on CD2, analyzing CD2 expression and its association with survival. CD2 expression was associated with tumor size (T stage) to some extent, but not with overall TNM stage, lymph node status (N stage), or distant metastasis (M stage). High CD2 expression was associated with longer survival. METABRIC data were used to validate the survival result (n = 276). Gene set enrichment analysis (GSEA) showed that the Kyoto Encyclopedia of Genes and Genomes (KEGG) pathways that were significantly associated with high CD2 expression were mainly immune-related pathways. Furthermore, CD2 expression was correlated with 16 types of tumor-infiltrating immune cells (TICs). Hence, CD2 might be a novel biomarker in terms of molecular typing, and it may serve as a complementary approach to TNM staging to improve clinical outcome prediction for BCa patients.