Pollutants in an environment can have long-term implications for the species living there, resulting in local adaptations with implications for their genetic structure. Heavy metal pollutants infiltrate soils and groundwater, bioaccumulate in food webs, and negatively impact biota. In this study, we investigated the degree to which the genetic structure and variability of the slender green-winged grasshopper (Aiolopus thalassinus (Fabricius) (Orthoptera: Acrididae)) were impacted by heavy metal pollution and distance. We used the random amplified polymorphic DNA-polymerase chain reaction (RAPD-PCR) method to examine the genetic variability of populations in 3 heavy metal-polluted and 3 unpolluted locations across varying geographical distances in Egypt. The heavy metal concentrations of cadmium, copper, lead, and zinc were measured from the grasshopper tissue and soils. Sixty-nine unique and polymorphic bands were produced by 4 primers. Cluster and principal component analyses separated the populations inside and outside Cairo into 2 main branches, which were further divided into smaller branches corresponding to their geographical regions. We found no differences in the Shannon genetic diversity index between populations or with increasing heavy metal concentrations in either the soil or the grasshopper tissue. Our results showed a greater genetic variation among populations than between populations within the same location, indicating populations within locations were less differentiated than those between locations. The moderate correlation between genetic similarity and spatial distance suggests geographical isolation influenced grasshopper population differentiation. Based on the RAPD analysis, environmental pollutants and geographical distances impact the A. thalassinus population structure, potentially restricting gene flow between sites even at small spatial scales.