Soil contamination by heavy metals, particularly mercury (Hg), is a problem that can seriously affect the environment, animals, and human health. Hg has the capacity to biomagnify in the food chain. That fact can lead to pathologies, of those which affect the central nervous system being the most severe. It is convenient to know the biological environmental indicators that alert of the effects of Hg contamination as well as the biological mechanisms that can help in its remediation. To contribute to this knowledge, this study conducted comparative analysis by the use of Shotgun metagenomics of the microbial communities in rhizospheric soils and bulk soil of the mining region of Almadén (Ciudad Real, Spain), one of the most affected areas by Hg in the world The sequences obtained was analyzed with MetaPhlAn2 tool and SUPER-FOCUS. The most abundant taxa in the taxonomic analysis in bulk soil were those of Actinobateria and Alphaproteobacteria. On the contrary, in the rhizospheric soil microorganisms belonging to the phylum Proteobacteria were abundant, evidencing that roots have a selective effect on the rhizospheric communities. In order to analyze possible indicators of biological contamination, a functional potential analysis was performed. The results point to a co-selection of the mechanisms of resistance to Hg and the mechanisms of resistance to antibiotics or other toxic compounds in environments contaminated by Hg. Likewise, the finding of antibiotic resistance mechanisms typical of the human clinic, such as resistance to beta-lactams and glycopeptics (vancomycin), suggests that these environments can behave as reservoirs. The sequences involved in Hg resistance (operon mer and efflux pumps) have a similar abundance in both soil types. However, the response to abiotic stress (salinity, desiccation, and contaminants) is more prevalent in rhizospheric soil. Finally, sequences involved in nitrogen fixation and metabolism and plant growth promotion (PGP genes) were identified, with higher relative abundances in rhizospheric soils. These findings can be the starting point for the targeted search for microorganisms suitable for further use in bioremediation processes in Hg-contaminated environments.