The northern Shaanxi region stands as the primary coal production hub in Shaanxi Province. Assessing the risk of heavy metal contamination in this mining area is of paramount importance for ensuring the sustainable development of the regional ecosystem and safeguarding human health. This study specifically focused on the Hongliulin mining area, where a total of 40 soil samples were meticulously collected and analyzed from within a 1000-meter radius extending from the tailings dam. The findings revealed that soil pH within the 0-1000m range generally leaned towards the alkaline side. In terms of soil nutrient content, encompassing factors such as soil organic matter (SOM), total nitrogen (TN), total phosphorus (TP), total potassium (TK), alkali nitrogen (AK), available phosphorus (AP), and quick-acting potassium (AK), the variations fell within the following ranges: 2.23~13.58 g/kg, 0.12 ~ 0.73 g/kg, 0.18 ~1.15 g/kg, 9.54 ~35.82 g/kg, 2.89 ~ 6.76 mg/kg, 3.45~11.25 mg/kg, and 5.86~130.85 mg/kg. Collectively, these values indicate relatively low levels of soil nutrients. Within the 0-500m range of soil samples, the average concentrations of Cd, Hg, Pb, and As were 0.778, 0.198, 24.87, and 17.92 mg/kg, respectively. These concentrations exceeded the established soil background values of Shaanxi Province and emerged as the primary pollutants in the study area. Within this same range, the mean values of eight heavy metals (Pi) were ranked in the following descending order: 1.726 (Hg), 1.400 (As), 1.129 (Cr), 1.109 (Pb), 0.623 (Zn), 0.536 (Cd), 0.309 (Cu), and 0.289 (Ni). With the exception of Hg, As, Cr, and Pb, which exhibited slight pollution, the other heavy metals were found to be within acceptable pollution limits for this sampling range, in line with the results obtained using the geo-accumulation index method. The average potential ecological risk index (RI) for the eight heavy metals in the study area stood at 185.0, indicating a moderate overall pollution level. When assessing individual elements, the proportions of ecological risk attributed to Hg, As, Pb, and Cd were 34.57%, 27.44%, 25.11%, and 23.11%, respectively. This suggests that the primary potential ecological risk elements in the study area are Hg and As, followed by Cd and Pb. Notably, heavy metals Hg and Pb, as well as As and Pb, exhibited significant positive correlations within the sampling area, suggesting a common source. An analysis of the relationship between soil physicochemical properties and heavy metals indicated that soil pH, organic matter, nitrogen, and phosphorus were closely linked to heavy metal concentrations. The soil in the sampling area has undergone significant disturbances due to human activities, resulting in heavy metal pollution and nutrient deficiencies.