Background: The purpose of this study is to use shotgun next-generation sequencing to unravel the microbial community structure of an agricultural soil, decipher the effects of mercury contamination on the structure of the microbial community and the soil physicochemistry and heavy metals content. Results: The soil physicochemistry after mercury contamination revealed a shift in soil pH from neutral (6.99 ± 0.001) to acidic (5.96 ± 0.25), a decline in moisture content to < 4 %, and a significant decrease in the concentrations of all the macronutrients and the total organic matter. Significant decrease in all the heavy metals detected in the agricultural soil was also observed in mercury inundated SL3 microcosm. Structural analysis of the metagenomes of SL1 (agricultural soil) and SL3 (mercury-contaminated agricultural soil) using Illumina shotgun next-generation sequencing revealed the loss due to mercury contamination of 54.75 % of the microbial community consisting of an archaeal domain, 11 phyla, 12 classes, 24 orders, 36 families, 59 genera, and 86 species. The dominant phylum, class, genus, and species in SL1 metagenome are Proteobacteria, Bacilli, Staphylococcus, and Sphingobacterium sp. 21; while in SL3 metagenome, Proteobacteria, Alphaproteobacteria, Singulisphaera, and Singulisphaera acidiphila were preponderant. Mercury contamination resulted in a massive upscale in the population of members of the phylum Planctomycetes and the genera Singulisphaera, Brevundimonas, Sanguibacter, Exiguobacterium, Desulfobacca, and Proteus in SL3 metagenome while it causes massive decline in the population of genera Staphylococcus and Brachybacterium. Conclusions: This study revealed that mercury contamination of the agricultural soil imposed selective pressure on the members of the microbial community, which negatively impact on their population, alter soil physicochemistry, and enriched sizable numbers of members of the community that are well adapted to mercury stress. It also reveals members of microbial community hitherto not reported to be important in mercury detoxification process.