Mercury (Hg) is a global pollutant that affects the health of humans and ecosystems. Selenium (Se) is an essential trace element for many organisms including humans. Bacillus subtilis is widely distributed in nature, is one of the main probiotics used in aquaculture, and has a certain adsorption effect on heavy metals. The interaction between Hg and Se was rigorously studied, especially due to the observation of the protective effect of Se on Hg toxicity. The common carp was exposed to Hg (0.03 mg/L), and 105 cfu/g Se-rich B. subtilis was added to the feed. After 30 days of feeding, samples were taken to evaluate the growth performance, serological response, inflammatory response, and intestinal microbial changes. In this study, when fish were exposed to Hg, the growth performance of the Se-rich B. subtilis plus 0.03 mg/L Hg fish group was lower than that of the control group and higher than 0.03 mg/L Hg; The levels of LZM and IgM decreased, but after supplementation with Se-rich B. subtilis, the levels of LZM and IgM increased; Hg treatment significantly up-regulated the mRNA expression of IL-1β, IL-8, TNF-α and NF-κB P65, but down-regulated the mRNA expression of IL-10, TGF-β and IkBα. However, compared with the Hg group, the Se-rich B. subtilis plus Hg group can significantly increase the mRNA expression levels of IL-1β, IL-8, TNF-α and NF-κB P65, but reduce the regulation of IL-10, TGF-β and IkBα expression. At the genus level, the abundance of Aeromonas in the intestines of common carp in the Hg treatment group increased, and Se-rich B. subtilis could reduce the abundance of Aeromonas (pathogenic bacteria). Through the analysis of the species, we found that the Hg group was mainly composed of Aeromonas sobria and Aeromonas hydrophila. However, in the Se-rich B. subtilis treatment group, we found that Aeromonas sobria was significantly less than the Hg group. Because Aeromonas (pathogenic bacteria) is harmful to the fish, it can induce inflammation in the fish and make the fish sick. Through microbiological analysis, it is found that Se-rich B. subtilis improves Hg-induced intestinal microbial changes, alleviates the abundance of Aeromonas, and alleviates the inflammation of the fish.