In this study, the activation mechanism of annealed Mg-doped GaN in air and the influence of ambient on activation of Mg-doped GaN were investigated. According to the experimental results, we found that the dissociation of MgGa–H, and the formation of hydrogenated gallium vacancies (VGaH2) and gallium vacancies occupied by interstitial Mg during the air-activation process, led to an increase in the hole concentration. In addition, from the observed photoluminescence results and the secondary ion mass spectroscopy measurements, it is suggested that the formation of VGaH2 will result in an enhancement of hydrogen desorption from the MgGa–H complexes.