We investigated structural changes during precipitation of HgS from sulfidic solutions using X-ray absorption and X-ray diffraction techniques. The results show that initially an unstable low Hg coordination complex forms that is probably chain-like in structure, with one sulfide atom at 2.35 Å and one at 2.97 Å. This is rapidly transformed to a four-coordinate mercury sulfide compound that initially forms as clusters with the local ordering characteristics of cubic metacinnabar. However, during aggregation the black Hg-S precipitate loses its initial longer-range ordering and becomes pseudocubic. As it ages, the pseudocubic structure transforms to a cubic structure, and then to stable crystalline metacinnabar. This study provides clear evidence that the precipitation and formation of metal sulfides is a complex multistage process.