In this study, 28 groundwater and 13 soil samples from Ahangaran mining district in Hamedan Province, west of Iran were collected to evaluate the level of contamination. Average concentrations of As, Cu, Pb, Zn, Mn, Sb, and Ni in groundwater samples were 1.39, 3.73, 2.18, 9.37, 2.35, 4.44, and 5.50 μg/L (wet season), and 11.64, 4.92, 4.32, 14.77, 5.43, 4.12, and 0.98 μg/L (dry season), respectively. Results of groundwater samples analysis showed that the average of analyzed metals in the wet and dry seasons were below the permissible limits, except As in the dry season which displays concentrations that exceed US EPA water quality criteria recommended for drinking water. Also, the heavy metal pollution index (HPI) values in each sampling station were less than the critical index limit and were suitable for drinking. Factor analysis revealed that variables influential to groundwater quality in one season may not be as important in another season. Average concentrations of Ag, As, Cd, Cu, Pb, Sb, and Zn in soil samples were 2.61, 31.44, 0.51, 55.90, 1284.9, 21.26, and 156.04 mg kg(-1), respectively. The results of the geoaccumulation index (I geo) showed the following decreasing order: Pb > Zn > Cu > As > Sb > Cd > Ag. Potential ecological risk index (RI) suggests that the contamination in the investigated area is moderate to very high risk and the ranking of the contaminants in decreasing order is Ag > Sb > Pb > Cd > As > Cu > Zn.