Urban soils are strongly related to human health. In this study, Lin'an city was chosen as a typical small-scale city with which to study the spatial variation of potentially hazardous metals (PHMs) in urban soils and their potential ecological risks using multivariate analysis, geostatistics and GIS techniques. A total of 62 soil samples were collected from the study area. The results showed that the average concentrations of total soil Mn, Cu, Zn, Pb, Cr, Cd were 439.42, 42.23, 196.80, 62.55, 63.65, 0.22 mgkg(-1), respectively. Compared with the background values and the environmental quality standards, these PHMs were accumulated in urban soils to some extent. The single potential ecological risk indices of PHMs indicated that Pb and Cd had relatively high ecological risks. The pH and most of the PHMs had significant correlations (p < 0.05). The principle components analysis (PCA) showed that Pb, Zn and Cu had similar pollution sources related to the vehicles' exhaust emission; Mn and Cr were mainly from the parent materials; while Cd was from the emission of industrial manufactories. The spatial structures and distributions of PHMs and their corresponding available fractions had strong/moderate spatial autocorrelation, which were influenced by human activities.