We used x-ray photoelectron spectroscopy to investigate the chemistry of O impurity atoms in CdS thin films grown for photovoltaic purposes by chemical-bath deposition (CBD). We compared the Cd 3d photoline, O 1s photoline, Cd MNN Auger line, and O KLL Auger line taken from a CBD CdS thin film, CdS single-crystal reference, Cd metal reference, CdO reference, and Cd(OH)2 reference. This comparison showed that the O present in thin-film CBD CdS is a manifestation of H2O incorporated into the film during the CBD growth. Ar+ ion sputtering, a technique frequently used in thin-film analyses, preferentially removed S from the CBD CdS thin film and created CdS1-xOx (x∼0.04) in the surface region from the incorporated O impurity. © 1997 American Institute of Physics.