Groundwater is a vital resource for human life and economic growth. In the Khanewal district of Punjab, Pakistan, environmental changes, and anthropogenic activities have made groundwater extremely vulnerable in the past forty years. Sixty-eight groundwater samples were collected from the study area, major ions and trace elements were analyzed. The Principal Component Analysis and Cluster Analysis were used to identify the major factors influencing groundwater quality, as well as to assess its suitability for drinking and irrigation in southern Punjab. The aquifers are slightly acidic to alkaline, according to the pH (6.9–9.2) of groundwater. Significant cations are distributed as follows: Na+ > Ca2+ > Mg2+ > K+, while anions are distributed as HCO3− > SO42− > Cl−. The main hydrochemical facies are mixed Na·Ca-HCO3 and Na·Ca (Mg)-HCO3·SO4. Rock weathering processes, such as the dissolution of calcite, dolomite, and gypsum minerals, governed groundwater hydrochemistry. The water quality index (WQI) indicates that 17.64% of the water samples are unsuitable to drink. However, according to the Wilcox diagram, the USSL diagram, and some other agricultural indices, approximately 68% of the groundwater samples are suitable for irrigation.