ObjectiveThe potential ecological risk index (RI) is the most commonly used method to assess heavy metals (HMs) contamination in soils. However, studies have focused on the response of soil microorganisms to different concentrations, whereas little is known about the responses of the microbial community structures and functions to HMs at different RI levels.MethodsHere, we conducted soil microcosms with low (L), medium (M) and high (H) RI levels, depending on the Pb and Cd concentrations, were conducted. The original soil was used as the control (CK). High-throughput sequencing, qPCR, and Biolog plate approaches were applied to investigate the microbial community structures, abundance, diversity, metabolic capacity, functional genes, and community assembly processes.ResultThe abundance and alpha diversity indices for the bacteria at different RI levels were significantly lower than those of the CK. Meanwhile, the abundance and ACE index for the fungi increased significantly with RI levels. Acidobacteria, Basidiomycota and Planctomycetes were enriched as the RI level increased. Keystone taxa and co-occurrence pattern analysis showed that rare taxa play a vital role in the stability and function of the microbial community at different RI levels. Network analysis indicates that not only did the complexity and vulnerability of microbial community decrease as risk levels increased, but that the lowest number of keystone taxa was found at the H level. However, the microbial community showed enhanced intraspecific cooperation to adapt to the HMs stress. The Biolog plate data suggested that the average well color development (AWCD) reduced significantly with RI levels in bacteria, whereas the fungal AWCD was dramatically reduced only at the H level. The functional diversity indices and gene abundance for the microorganisms at the H level were significantly lower than those the CK. In addition, microbial community assembly tended to be more stochastic with an increase in RI levels.ConclusionOur results provide new insight into the ecological impacts of HMs on the soil microbiome at different risk levels, and will aid in future risk assessments for Pb and Cd contamination.