Identifying the sources of heavy metals (HMs) in river sediments is crucial to effectively mitigate sediment HM pollution and control its associated ecological risks in coal-mining areas. In this study, ecological risks resulting from different pollution sources were evaluated using an integrated method combining the positive matrix factorization (PMF) and the potential ecological risk index (RI) model. A total of 59 sediment samples were collected from the Kuye River and analyzed for eight HMs (Zn, Cr, Ni, Cu, Pb, As, Cd, and Hg). The obtained results showed that the sediment HM contents were higher than the corresponding soil background values in Shaanxi Province. The average sediment Hg content was 3.42 times higher than the corresponding background value. The PMF results indicated that HMs in the sediments were mainly derived from industrial, traffic, agricultural, and coal-mining sources. The RI values ranged from 26.15 to 483.70. Hg was the major contributor (75%) to the ecological risk in the vicinity of the Yanjiata Industrial Park. According to the PMF-based RI model, coal-mining activities exhibited the strongest impact on the river ecosystem (48.79%), followed, respectively, by traffic (34.41%), industrial (12.70%), and agricultural (4.10%) activities. These results indicated that the major anthropogenic sources contributing to the HM contents in the sediments are not necessarily those posing the greatest ecological risks. The proposed integrated approach in this study was useful in evaluating the ecological risks associated with different anthropogenic sources in the Kuye River, providing valuable suggestions for reducing sediment HM pollution and effectively protecting river ecosystems.