Background and Objective: Due to the high potential of Hamedan city for agricultural products and subsequentlly effects of urban wastewaters and agricultural activities such as the use of fertilizers and chemical pesticides on soil quality, plant, and human health, performing this research was necessary. This research was done by purpose of investigating the effect of wastewater on accumulation of metals Pb and Cd in soil and vegetables. Method: For this purpose, sampling from soil and vegetables was performed randomly in the city of Hamedan. Sampling was done in an area irrigated with well water and in an area irrigated with wastewater. Vegetable Samples were prepared after washing and drying, powdered and prepared for experiment. Also soil samples after air-drying, sieve, and prepared for experiment. Then samples digested with acid mixture and heavy metals measured by Atomic Adsorption Spectroscopy (AAS). Finally obtained data were analyzed by SPSS 20. Findings: Results showed that wastewater had important effect on accumulation of Pb and Cd in soil and vegetables which means concentration of these metals in the soil and vegetables that was irrigated with wastewater was higher than those irrigated with well water. Also this is identified that the concentrations of Pb and Cd in studied vegetables was higher or equal to standards and Cd in the soil of both control and treatment were or equal to standards but Pb were lower than standards. Discussion and Conclusion: Since, in the treatment area, the mean concentration of Cd in scallion vegetable and mean concentration of Pb in leek vegetable is higher than standard. Therefore, in order to prevent creating problems for citizens’ health, irrigation of fields by wastewater must be prevented.