BackgroundAcute myocardial infarction (AMI) is one of the leading causes of death worldwide. The etiology of AMI is complex and has not been fully defined. In recent years, the role of immune response in the development, progression and prognosis of AMI has received increasing attention. The aim of this study was to identify key genes associated with the immune response in AMI and to analyze their immune infiltration.MethodsThe study included a total of two GEO databases, containing 83 patients with AMI and 54 healthy individuals. We used the linear model of microarray data (limma) package to find the differentially expressed genes associated with AMI, performing weighted gene co-expression analysis (WGCNA) to further identify the genes associated with inflammatory response to AMI. We found the final hub genes through the protein-protein interaction (PPI) network and least absolute shrinkage and selection operator (LASSO) regression model. To verify the above conclusions, we constructed mice AMI model, extracting myocardial tissue to perform qRT-PCR. Furthermore, the CIBERSORT tool for immune cells infiltration analysis was also carried out.ResultsA total of 5,425 significant up-regulated and 2,126 down-regulated genes were found inGSE66360andGSE24519. A total of 116 immune-related genes in close association with AMI were screened by WGCNA analysis. These genes were mostly clustered in the immune response on the basis of GO and KEGG enrichment. With construction of PPI network and LASSO regression analysis, this research found three hub genes (SOCS2, FFAR2, MYO10) among these differentially expressed genes. The immune cell infiltration results revealed that significant differences could be found on T cells CD4 memory activated, Tregs (regulatory T cells), macrophages M2, neutrophils, T cells CD8, T cells CD4 naive, eosinophils between controls and AMI patients.