Sorption of mercury(II) onto well-characterized samples of pyrite was studied between pH 2 and 12 using X-ray photoelectron spectroscopy for surface analysis and extended X-ray absorption fine structure for surface speciation. In the presence of Hg, the surface oxidation of pyrite was strongly decreased. Even if the sorption capacity of pyrite for Hg was high, the sorption reversibility was possible by adding some strong ligands, such as I-, S2O32-, and CN-, to the aqueous phase. Spectroscopic studies showed the absence of Hg(0) and S(−II) and evidenced the formation of a surface complex between S(−I) and Hg(II). At low pH, ternary surface complexes ⋮S-I−Hg−OH or ⋮S-I−Hg−Cl were formed with the following distances: R⋮S-Hg = 2.40 Å, RHg-OH = 2.25 Å, and RHg-Cl = 2.33 Å if Cl- was present. At high pH, the spectroscopic signals of Hg, S, or Fe decreased, possibly because of the presence at the surface of a solid solution constituted of Fe (hydr)oxides and surface complexes between Hg and both oxides and pyritic sulfur.