We present here the passivation mechanism and the chemistry of an (NH4)2Sx-treated Mg-doped GaN surface examined by using x-ray photoelectron spectroscopy. The native oxide on the GaN surface can be removed by the (NH4)2Sx treatment process. The S atoms not only bond as elemental sulfur and disulfides, but occupy nitrogen-related vacancies.