Dominant microorganisms and functional genes, including hgcA, hgcB, merA, and merB, have been identified to be responsible for mercury (Hg) methylation or methylmercury (MeHg) demethylation. However, their in situ correlation with MeHg levels and the processes of Hg methylation and MeHg demethylation in coastal areas remains poorly understood. In this study, four functional genes related to Hg methylation and MeHg demethylation (hgcA, hgcB, merA, and merB) were all detected in the sediments of the Eastern China Coastal Seas (ECCSs) (representative coastal seas highly affected by human activities) using metagenomic approaches. HgcA was identified to be the key gene controlling the in situ net production of MeHg in the ECCSs. Based on metagenomic analysis and incubation experiments, sulfate-reducing bacteria were identified as the dominant microorganisms controlling Hg methylation in the ECCSs. In addition, hgcA gene was positively correlated with the MeHg content and Hg methylation rates, highlighting the potential roles of Hg methylation genes and microorganisms influenced by sediment physicochemical properties in MeHg cycling in the ECCSs. These findings highlighted the necessity of conducting similar studies in other natural systems for elucidating the molecular mechanisms underlying MeHg production in aquatic environments.