Mercury cadmium telluride (Hg(1-x)Cd(x)Te or MCT) has been commonly used in devices for infrared (IR) detection. For the optimum performance of the device, a compatible surface-passivation technology that provides long-term stability is required. Using x-ray photoelectron spectroscopy (XPS), the present study examines the effects on Hg(0.8)Cd(0.2)Te passivated with CdTe and ZnS undergoing baking in vacuum at temperatures typically used for dewar bakeout. Spectra recorded as a function of depth in both cases clearly show out-diffusion of Hg from the substrate toward the surface, even before the bakeout. On baking in vacuum, dramatic changes are observed in the ZnS/MCT case with complete loss of Hg from the sample up to the tested depth of more than 1,000 A. Compositions of the HgCdTe matrix, formed after Hg out-diffusion, before and after the bakeout are also calculated at selected depths (from 250 A to 700 A), which is vital information from a device point of view, as it affects the bandgap of this narrow-band semiconductor.