The aim of this study is to analyse the concentration of potentially toxic elements (PTEs) in urban soils under the influence of mining activities and to determine its sources. For this purpose, topsoil samples of the public parks and green areas in Minas de Riotinto (a town next to one of the largest open pit mines in the world) and Aracena (a nearby town outside the area of influence of the mine) were collected. The concentrations of elements of interest (Cr, Co, Ni, Cu, Zn, As, and Pb) were determined and compared based on soil location and origin ( in-situ or ex-situ), and with the background and regulatory levels for the region. The elemental concentrations in the fine fraction of the soils (particles <50 µm) were also measured. The concentrations of some PTEs (Cu, As and Pb), also found in the dust from nearby mines, were higher in the in-situ soils of Minas de Riotinto than in those of Aracena. The concentrations of PTEs in ex-situ soils of both towns were much lower than in in-situ soils, and similar between both locations, revealing the influence of the parent material as a primary source of PTEs. However, the concentrations of As and Cu in the ex-situ soils of Minas de Riotinto were significantly higher than the ones in Aracena, with a significant increase of these elements in the fine fraction both for in-situ and ex-situ soils. These two elements are directly related to the mining activity, implying that atmospheric deposition of dust from the mines also contributes to increasing the concentration of PTEs in the soils of Minas de Riotinto. These pollution sources lead to soils with potentially dangerous concentrations of pollutants, which should be further studied and evaluated in relation to their long-term influence on human health.