Rejection seriously affects the success of kidney transplantation. However, the molecular mechanism of the occurrence of rejection remains unclear. Firstly, GSE21374 and GSE36059 dataset were downloaded from the Gene Expression Omnibus (GEO) database. Next, Cell-type Identification by Estimating Relative Subsets of RNA Transcripts (CIBERSORT) algorithm was selected to infer the proportions of 22 immune cells. Moreover, infiltrating immune cells-related genes were identified by weighted gene co-expression network analysis (WGCNA), and enrichment analysis was conducted to observe their biological function. Furthermore, Extreme Gradient Boosting (XGBoost) and Least Absolute Shrinkage and Selection Operator (LASSO) logistic regression algorithm was selected to screen hub genes. Ultimately, quantitative real-time-PCR were conducted to verify the numbers of immune cells and the expressions of hub genes. Down-regulated B cells memory, Plasma cells, and Mast cell and up-regulated T cells follicular helper, T CD8 cells, Macrophages M1, T Cells CD4 memory activated, and T cells gamma delta were up-regulated were observed in rejections. Subsequently, ARS, CD8A, CRTAM, GBP2 and VAMP5 were screened as hub genes by XGBoost and LASSO algorithm, and might be used to the diagnostic biomarkers. Finally, differential analysis and quantitative real-time-PCR suggested that ARS, CD8A, CRTAM, GBP2 and VAMP5 were up-regulated in rejection samples compared to non-rejection samples. The present study identified 5 key infiltrating immune cells-related genes (ARS, CD8A, CRTAM, GBP2 and VAMP5) in rejection of kidney transplantation, which may contribute to explain the molecular mechanism of rejection in kidney transplantation development.