Heavy metals (HMs) are naturally occurring elements that have high natural background levels in the environment. Therefore, it is important to conduct ecological risk assessment and identify potential sources of HMs. In the past, studies were conducted at the regional scale. The accuracy of those studies could not meet the needs of spatial planning and natural resource management. Therefore, it is necessary to conduct ecological risk assessment at the township scale. In this study, 1092 soil samples (from 0-20 cm depth) were collected in the town of Reshui, an area with high background levels of soil HMs with the parent material of carbonatite, which is commonly found in Southwest China. The town of Reshui is a multi-ecological risk superimposed area where the ecological risk is high. In this study, concentrations of HMs (Cd, Cr, As, Hg, Pb, Cu, Zn, and Ni) in the topsoil were analyzed, and statistical analysis (SA), geographic information system (GIS) modeling, and positive matrix factorization (PMF) analysis were performed. The geoaccumulation index (Igeo) and potential ecological risk index (PERI) were applied for the ecological risk assessment and quantification of the sources of the soil HMs. The mean values of HM concentrations in the topsoil were 18.1, 1.18, 174.1, 202.2, 0.09, 71.1, 34.9, and 167.2 mg ·kg-1for As, Cd, Cr, Cu, Hg, Ni, Pb, and Zn, respectively, which were considerably higher than the average background value (ABV) in soils in Yunnan Province except for As and Pb. The average concentrations of Cd, Cr, Cu, and Ni exceeded the screening values specified in the soil contamination risk in agricultural land (GB 15618-2018) by 5.82, 1.16, 4.04, and 1.02 times, respectively. The Igeo value shows that the major pollutant is Cu in the surface soil of the study area, followed by Cr, and Cd. Speciation analysis of HMs indicates that HMs (Cr, As, Pb, Cu, Zn, and Ni) mainly exist in the residual form, mostly from the geological background with low bioavailability. The potential effective components of Hg have higher levels, but the total amount of Hg and its pollution risk are lower. Cd has a high bioavailability ratio, is easy to enter the soil solution and be absorbed by crops, and is the HM with the highest pollution risk in the study area. The PERI shows that the proportions of low ecological risk, moderate risk, and high risk soil samples are 44.23%, 54.40%, and 1.37% of the total number of samples, respectively. Hg and Cd were the major sources of risk because of their high toxicity coefficient. The PMF analysis indicates that there are four major sources of HMs in the study area: human activity, natural sources, coal mining and traffic emissions, and agricultural sources with the risk contribution ratios of 9.29%, 53.67%, 11.23%, and 25.81%, respectively. The PMF analysis effectively quantified the ecological risk from these sources, providing a reference for further pollution control and prevention measures.