Acute pancreatitis (AP) is a common systemic inflammatory disease resulting from the activation of trypsinogen by various incentives in ICU. The annual incidence rate is approximately 30 out of 100,000. Some patients may progress to severe acute pancreatitis, with a mortality rate of up to 40%. Therefore, the goal of this article is to explore the key genes for effective diagnosis and treatment of AP. The analysis data for this study were merged from two GEO datasets. 1357 DEGs were used for functional enrichment and cMAP analysis, aiming to reveal the pathogenic genes and potential mechanisms of AP, as well as potential drugs for treating AP. Importantly, the study used LASSO and SVM-RFE machine learning to screen the most likely AP occurrence biomarker for Prdx4 among numerous candidate genes. A receiver operating characteristic of Prdx4 was used to estimate the incidence of AP. The ssGSEA algorithm was employed to investigate immune cell infiltration in AP. The biomarker Prdx4 gene exhibited significant associations with a majority of immune cells and was identified as being expressed in NKT cells, macrophages, granulocytes, and B cells based on single-cell transcriptome data. Finally, we found an increase in Prdx4 expression in the pancreatic tissue of AP mice through immunohistochemistry. After treatment with recombinant Prdx4, the pathological damage to the pancreatic tissue of AP mice was relieved. In conclusion, our study identified Prdx4 as a potential AP hub gene, providing a new target for treatment.