Urbanization processes affect the accumulation of trace elements in urban soils. Due to the rapid urbanization, trace elements are continuously emitted into urban soil and generate serious risk to human health and urban ecosystem. Therefore, the effects of urbanization on environmental quality of soil along an urbanization gradient has emerged as an important frontier in environmental research. We carried out this study to assess the distribution, pollution, and potential ecological risk of trace elements in topsoil along a typical urbanization gradient in Urumqi city, NW China. We collected a total of 77 topsoil samples from urban, suburban, and rural gradient zones and analyzed their concentrations of nine trace elements: cadmium (Cd), cobalt (Co), copper (Cu), mercury (Hg), nickel (Ni), lead (Pb), antimony (Sb), vanadium (V), and zinc (Zn). To estimate pollution and the ecological risk from trace elements, we employed the pollution load index (PLI) and ecological risk index (RI). The results we obtain indicated that the concentrations, spatial distributions, pollution levels, and ecological risk degrees of trace elements investigated in this study were closely correlated with urbanization process. The spatial distribution of Cd, Co, Ni, Pb, Sb, V, and Zn concentrations and PLI showed a zonal distribution pattern along the urbanization gradient. The PLI values decreased in the order of urban > suburban > rural, whereas the RI values decreased in the order of urban > rural > suburban. Furthermore, trace elements showed a considerable risk in urban gradient, moderate risk in suburban and rural gradient zones, and Hg poses the most significant ecological risk among the investigated trace elements. Overall, analysis of trace elements in topsoil is useful to identify the effects of urbanization.