The variable coordination behaviour of the mixed ligand 1-(2-hydroxyethyl)-3,5-dimethylpyrazole (L) towards Zn(ii), Cd(ii) and Hg(ii) ions has been investigated. Three new complexes, [ZnCl2(L)] (1), [CdCl2(L)]2 (2), and [HgCl2(L)]n (3), with different structures and topologies have been fully characterized by analytical and spectroscopic techniques including heteronuclear 113Cd and 199Hg NMR analyses. Complexes 1-3 were also characterized by single crystal and powder X-ray diffraction techniques. The L ligand exhibits high versatility and provides different environments to the metal centre as a function of its diverse coordination mode. The weak π-π stacking interactions and intermolecular hydrogen bonds resulted in the two-dimensional network structures. All these results point out the structural diversity of the hybrid pyrazole ligand on its coordination. Finally, we determined the fluorescent properties of complexes 1-3. Surprisingly, L displays a high selectivity for Hg(ii) ion. The findings indicate that the variable behaviour of the hydroxyl group substituent exerts an important effect on the spectroscopic properties. Moreover, the fluorescence of these complexes has been rationalized through theoretical calculations. The primary results suggest that the use of L is a promising strategy to synthesize novel materials with unique photoluminescent properties and further applications for the detection of heavy metals in real environmental samples. © 2011 The Royal Society of Chemistry.