Mg-doped GaN films grown by metalorganic chemical vapor deposition were characterized by variable-temperature Hall-effect measurements and Fourier-transform infrared absorption spectroscopy. As-grown, thermally activated, and deuterated Mg-doped GaN samples were investigated. The existence of Mg-H complexes in GaN is demonstrated with the observation of a local vibrational mode (LVM) at 3125 cm(-1) (8 K). At 309 K this absorption line shifts to 3122 cm(-1). The intensity of the LVM line is strongest in absorption spectra of as-grown GaN:Mg which is semi-insulating. Upon thermal activation, the intensity of the LVM line significantly decreases and an acceptor concentration of 2x10(19)cm(-3) is derived from the Hall-effect data.. After deuteration at 600 degrees C the resistivity of the Mg-doped GaN increased by four orders of magnitude. A LVM line at 2321 cm(-1) (8 K) appears in the absorption spectra which is consistent with the isotopic shift of the vibrational frequency when D is substituted for H.