Long-term coal mining activities have led to severe heavy metal pollution in the soil environment of coal mining areas, posing significant threats to both ecological environments and human health. In this study, surface soil samples were collected from the overlying soil of coal gangue and the surrounding areas of the Panyi coal mine in Huainan. The concentrations of Cd, Zn, Cu, Ni, and Pb elements were determined. A self-organizing map (SOM) and an absolute principal component score multiple linear regression (APCS-MLR) receptor model were employed for the quantitative analysis of the soil’s heavy metal pollution sources and contributions. Additionally, this study focused on the analysis of the pathways of the relatively serious pollution of Cd. The results revealed that the average concentrations of heavy metals (Cd, Pb, Zn, Cu, Cr, and Ni) in the study area were 4.55, 0.59, 1.54, 0.69, 0.59, and 0.71 times the local soil background values, respectively. The concentrations of Cd and Zn exceeded the risk screening values at some sampling points, with exceedance rates of 44% and 8%, respectively, indicating a relatively serious Cd contamination. The sources of heavy metals in the soil in the study area were classified into four categories: mining activities, agricultural activities, weathering of natural matrices, and other unknown sources, with average contributions of 55.48 percent, 24.44 percent, 8.91 percent and 11.86 percent, respectively. Based on the spatial distribution of Cd, it was inferred that atmospheric deposition is one of the important pollution pathways of Cd in the study area. Cd profile distribution patterns and a surface water pollution survey showed that the farmland areas were affected by the irrigation water pathway to some extent. The vertical distribution of heavy metal content in the forest area showed a strong disorder, which was related to the absorption function of plant roots. The results of this study can help to improve the environmental management of heavy metal pollution so as to protect the ecological environment and human health.