ObjectiveBreast cancer is a prevalent malignancy that predominantly affects women. The development and progression of this disease are strongly influenced by the tumor microenvironment and immune infiltration. Therefore, investigating immune-related genes associated with breast cancer prognosis is a crucial approach to enhance the diagnosis and treatment of breast cancer.MethodsWe analyzed data from the TCGA database to determine the proportion of invasive immune cells, immune components, and matrix components in breast cancer patients. Using this data, we constructed a risk prediction model to predict breast cancer prognosis and evaluated the correlation between KLRB1 expression and clinicopathological features and immune invasion. Additionally, we investigated the role of KLRB1 in breast cancer using various experimental techniques including real-time quantitative PCR, MTT assays, Transwell assays, Wound healing assays, EdU assays, and flow cytometry.ResultsThe functional enrichment analysis of immune and stromal components in breast cancer revealed that T cell activation, differentiation, and regulation, as well as lymphocyte differentiation and regulation, play critical roles in determining the status of the tumor microenvironment. These DEGs are therefore considered key factors affecting TME status. Additionally, immune-related gene risk models were constructed and found to be effective predictors of breast cancer prognosis. Further analysis through KM survival analysis and univariate and multivariate Cox regression analysis demonstrated that KLRB1 is an independent prognostic factor for breast cancer. KLRB1 is closely associated with immunoinfiltrating cells. Finally,in vitroexperiments confirmed that overexpression of KLRB1 inhibits breast cancer cell proliferation, migration, invasion, and DNA replication ability. KLRB1 was also found to inhibit the proliferation of breast cancer cells by blocking cell division in the G1/M phase.ConclusionKLRB1 may be a potential prognostic marker and therapeutic target associated with the microenzymic environment of breast cancer tumors, providing a new direction for breast cancer treatment.