The contamination of water with heavy metal ions represents a harsh environmental problem resulting from societal development. Among various hazardous compounds, mercury ions (Hg2+) surely belong to the most poisonous ones. Their accumulation in the human body results in health deterioration, affecting vital organs and eventually leading to chronic diseases, and, in the worst-case scenario, early death. High selectivity and sensitivity for the analyte of choice can be achieved in chemical sensing using suitable active materials capable of interacting at the supramolecular level with the chosen species. Among them, 2D transition metal dichalcogenides (TMDCs) have attracted great attention as sensory materials because of their unique physical and chemical properties, which are highly susceptible to environmental changes. In this work, we have fabricated MoS2-based field-effect transistors (FETs) and exploited them as platforms for Hg2+ sensing, relying on the affinity of heavy metal ions for both point defects in TMDCs and sulphur atoms in the MoS2 lattice. X-ray photoelectron spectroscopy characterization showed both a significant reduction of the defectiveness of MoS2 when exposed to Hg2+ with increasing concentration and a shift in the binding energy of 0.2 eV suggesting p-type doping of the 2D semiconductor. The efficient defect healing has been confirmed also by low-temperature photoluminescence measurements by monitoring the attenuation of defect-related bands after Hg2+ exposure. Transfer characteristics in MoS2 FETs provided further evidence that Hg2+ acts as a p-dopant of MoS2. Interestingly, we observed a strict correlation of doping with the concentration of Hg2+, following a semi-log trend. Hg2+ concentrations as low as 1 pM can be detected, being way below the limits imposed by health regulations. Electrical characterization also revealed that our sensor can be efficiently washed and used multiple times. Moreover, the developed devices displayed a markedly high selectivity for Hg2+ against other metal ions as ruled by soft/soft interaction among chemical systems with appropriate redox potentials, being a generally applicable approach to develop chemical sensing devices combining high sensitivity, selectivity and reversibility, to meet technological needs.