The concentrations of Pb, Zn, Cu, Cd and Cr in the stream sediment in the Baoji City section of the Weihe River, Northwest China, were determined to evaluate their contamination levels, spatial distribution and potential ecological risk. The average concentrations of the heavy metal sediments were 52.92 mg kg−1 for Pb, 99.04 mg kg−1 for Zn, 17.43 mg kg−1 for Cu, 0.79 mg kg−1 for Cd and 86.97 mg kg−1 for Cr. The result of the assessment indicates that the pollution by Cd is serious, Zn and Cr are moderate and Cu is relatively light or unpolluted. The correlation analysis showed that the five heavy metals are significantly associated with each other. The hierarchical cluster analysis suggested that Zn, Cr and Pb might have identical anthropogenic and natural sources in stream sediments while Cu and Cd might have the same source in the Baoji City section of the Weihe River.