Background The aim of this study is to establish a prognostic risk assessment model for coexpressed M2 related genes and to elucidate the role of M2 macrophages within the ccRCC (Clear cell carcinoma of the kidney) immune microenvironment, which may have the potential to enhance the efficacy of ccRCC treatment.Method Transcriptome data, clinical data, and mutation data were obtained from TCGA-KIRC. CIBERSORT was used to calculate the proportion of M2 macrophage cells of each of the 539 samples. Genes associated with macrophage M2 in TCGA-KIRC with the external dataset E-MTAB-1980 from the Arrayexpress database were determined by intersection, and a coexpression network was established. Following lasso regression, a prognostic model was constructed, factors with significant findings were entered into a Cox regression analysis. Next, we used the external dataset E-MTAB-1980 from the ArrayExpress database for validation. Lastly, risk score was evaluated by stroma immune infiltration, GSEA, TMB and drug sensitivity.Results We obtained the top 46 genes most strongly correlated with macrophage M2 in TCGA-KIRC, which are enriched in immune receptor activity, leukocyte and mononuclear cell migration. A model of twelve genes related to the coexpressed macrophage M2 gene was established, we demonstrated that it has good prognostic capacity.Conclusion We proposed a twelve-gene Cox proportional hazard regression model associated with M2 ccRCC macrophage that could provide a measurement method to generate prognostic scores in patients with ccRCC. We discovered that the M2 macrophage infiltration was closely related to tumor metabolism and inversely correlated with risk score in ccRCC. The observations we report here have the potential to provide meaningful candidate biomarkers for the treatment and surveillance of ccRCC.