Hg(2+) is able to inhibit the peroxidase-like DNAzyme function of a T-containing G-quadruplex DNA via Hg(2+)-mediated T-T base pairs, which enables the visual detection of Hg(2+) in the TMB-H(2)O(2) reaction system with high selectivity and sensitivity.