Chemical properties and pollution of water resources were studied in the Chah basin that is located in the Hamadan province, western Iran. Water quality was characterized according to its major constituents and the geological features of the area. Chemical analysis results indicate that groundwaters show wide concentration ranges in major inorganic ions, reflecting complex hydrochemical processes. Groundwater in the studied area is, for the most part, weakly to moderately mineralized and dominated by the calcium (Ca2+) and bicarbonate ( $$ {\text{HCO}}^{{\text{ - }}}_{{\text{3}}} $$ ) ions. Within the basin, three different hydrogeochemical facies have been identified: Ca-HCO3, Ca-SO4 and Mg-HCO3. The predominant water type of groundwater samples is the Ca-HCO3 facies in the recharge area and has a tendency toward Mg-HCO3 and Ca-SO4 facies along the direction of water flow. The samples were classified into four groups based on chloride (Cl−) and nitrate ( $$ {\text{NO}}^{{\text{ - }}}_{{\text{3}}} $$ ) concentrations and the processes that control water chemistry has been discussed. The results explained the importance of cation exchange, mineral weathering, and anthropogenic activities on groundwater chemistry. It was indicated that cation exchange and Cl-salt inputs are the major process controlling the water chemistry of the low Cl− and high $$ {\text{NO}}^{{\text{ - }}}_{{\text{3}}} $$ (group 2) and high Cl− and $$ {\text{NO}}^{{\text{ - }}}_{{\text{3}}} $$ (group 4). Groundwaters low in $$ {\text{NO}}^{{\text{ - }}}_{{\text{3}}} $$ and high in Cl− (group 3) and low in $$ {\text{NO}}^{{\text{ - }}}_{{\text{3}}} $$ and Cl− (group 1) are mainly affected by cation exchange and mineral dissolution. Pollution of groundwaters appeared to be affected by the application of fertilizers, irrigation practice, and solubility of mineral phases and discharge of domestic sewage. Measuring and predicting the mass loading of pollutant to groundwater from specific agricultural systems seems to be useful aids in controlling pollutions in groundwater.