Groundwater hydrochemistry analysis can be used to assess the general quality of groundwater as well as how groundwater has changed over time and how anthropogenic activities have affected it. In this study, total dissolved solids (TDS), pH and 10 ions (Na+, K+, Mg2+, Ca2+, Cl-, SO42-, NO3-, CO32-, HCO3- and F-) were measured at 34 sites in the main urban area of Lanzhou, a major city in northwest China, by means of boreholes in 2002 and 2022 respectively. The evolution of groundwater chemistry in the region over a twenty-year period due to mineral weathering and dissolution, ion exchange, and urban activity was explained using a geochemical model, chlor-alkalinity index, and correlations between Cl- and NO3- in the urban area. In addition, statistical methods were used to analyze groundwater ion sources and compare the ion source characteristics over a twenty-year period to reveal the extent to which urbanization and industrialization have influenced groundwater. The results show that overall groundwater quality in the area has improved over the last two decades, with little change in groundwater chemistry type. Furthermore, the chemical ions in groundwater were influenced less by industrialization and more by urban anthropogenic activities, which include not only urban wastewater discharge but also the rapid reduction of groundwater levels due to extensive urban construction activities. It is recommended that groundwater quality be further improved through enhanced municipal management measures, which should focus on the threat posed by groundwater precipitation in addition to considering the control of sewage discharge.