Soil pollution occurring at mining sites has adverse impacts on soil microbial diversity. New approaches, such as metagenomics approach, have become a powerful tool to investigate biodiversity of soil microbial communities. In the current study, metagenomics approach was used to investigate the microbial diversity of soils contaminated with different concentrations of lead (Pb) and zinc (Zn). The contaminated soils were collected from a Pb and Zn mine. The soil total DNA was extracted and 16S rDNA genes were amplified using universal primers. The PCR amplicons were sequenced and bioinformatic analysis of metagenomes was conducted to identify prokaryotic diversity in the Pb- and Zn-contaminated soils. The results indicated that the ten most abundant bacteria in all samples were Solirubrobacter (Actinobacteria), Geobacter (Proteobacteria), Edaphobacter (Acidobacteria), Pseudomonas (Proteobacteria), Gemmatiomonas (Gemmatimonadetes), Nitrosomonas, Xanthobacter, and Sphingomonas (Proteobacteria), Pedobacter (Bacterioidetes), and Ktedonobacter (Chloroflexi), descendingly. Archaea were also numerous, and Nitrososphaerales which are important in the nitrogen cycle had the highest abundance in the samples. Although, alpha and beta diversity showed negative effects of Pb and Zn contamination on soil microbial communities, microbial diversity of the contaminated soils was not subjected to a significant change. This study provided valuable insights into microbial composition in heavy metals-contaminated soils.