China is facing a severe groundwater quality crisis amid economic development and climate change, yet the extent and trajectory of this crisis remain largely unknown. Here we developed a machine-learning model, incorporating natural and social-economic factors, to construct annual probabilistic maps of poor groundwater quality (PGQ, i.e., Class V based on the Chinese groundwater quality standard) across China from 1980 to 2100. Alarmingly, our findings indicate a concerning escalation in PGQ area ratio, rising from 17.3% in 1980 to 30.1% in 2000, and surging to 40.8% by 2020, adversely affecting 6.8%, 17.5%, and 36.0% of the Chinese population, respectively. The predominant drivers of this degradation were identified as agricultural discharge (contributing to 10.7% growth in PGQ area ratio), followed by groundwater exploitation (5.6%), industrial discharge (5.3%), domestic discharge (1.7%), climate change (0.5%), and land use change (-0.3%). By 2050, the PGQ area ratio could range from 37.9% to 48.3% under different socio-economic and climate scenarios. Our study highlights the urgent need for effective water resources management and conservation measures to mitigate the deteriorating trend of groundwater quality and address the challenges posed by socio-economic development and climate change, thereby safeguarding water security for China and the global community.