A zinc germanium phosphorus (ZnGeP2) crystal with a chalcopyrite structure is an efficient frequency converter in the mid-infrared region. However, point defect-induced optical absorption at the pumping wavelength (near infrared region) blocked the further application of ZnGeP2. To alleviate the absorption losses caused by point defects, in situ magnesium doping compensation was presented during the ZnGeP2 bulk crystal growth process via the vertical Bridgman method. Combined with theoretical calculations, the structural distortion of the magnesium-doped ZnGeP2 crystals in different orientations was illustrated. The thermodynamic and kinetic stability of the magnesium-doped ZnGeP2 structure were demonstrated. The transmission results indicated the improvement of transmittance within a wavelength range of 1.8-2.4 μm when doped with magnesium, which revealed the powerful ability of the appropriate dopant in optimizing near-infrared optical properties. Thus, the introduction of magnesium is a practical approach to improve the transmittance performance and extend the pumping source wavelengths of ZnGeP2 crystals.