Heavy metal (HM) contaminants are the emerging driving force for reshaping the microflora of plants by eradicating the non-tolerance and non-resistant microbes via their lethal effects. Seeds served as a prime source of ancestral microbial diversity hereditary transfer from generation to generation. However, the problem arises when they got exposed to metal contamination, does metal pollutant disrupt the delicate balance of microbial communities within seeds and lead to shifts in their microflora across generations. In this study, the endophytic community within Zea mays seeds was compared across three distinct regions in Yunnan province, China: a HM-contaminated site Ayika (AK), less-contaminated site Sanduoduo (SD), and a non-contaminated Site Dali (DL). High-throughput sequencing techniques were employed to analyze the microbial communities. A total of 492,177 high-quality reads for bacterial communities and 1,001,229 optimized sequences for fungal communities were obtained. These sequences were assigned to 502 and 239 operational taxonomic units (OTUs) for bacteria and fungi, respectively. A higher diversity was recorded in AK samples than in SD and DL. Microbial community structure analysis showed higher diversity and significant fluctuation in specific taxa abundance in the metal-polluted samples exhibiting higher response of microbial flora to HM. In AK samples, bacterial genera such as Gordonia and Burkholderia-Caballeronia-Paraburkholderia were dominant, while in SD Pseudomonas and Streptomyces were dominant. Among the fungal taxa, Fusarium, Saccharomycopsis, and Lecanicillium were prevalent in HM-contaminated sites. Our finding revealed the influential effect of HM contaminants on reshaping the seed microbiome of the Zea mays, showing both the resilience of certain important microbial taxa as well the shifts in the diversity in the contaminated and pristine conditions. The knowledge will benefit to develop effective soil remediation, reclamation, and crop management techniques, and eventually assisting in the extenuation of metal pollution's adverse effects on plant health and agricultural productivity.