We demonstrated activation annealing of Mg‐doped p‐type Al0.17Ga0.83N in different gases. The hole concentration of Al0.17Ga0.83N annealed in oxygen is higher than that annealed in nitrogen or air. A hole concentration of 1.3 × 1016 cm−3 at room temperature was achieved by annealing in oxygen flow at 900 °C. Secondary ion mass spectroscopy shows that hydrogen dissociation from Mg‐doped Al0.17Ga0.83N is found to be enhanced by annealing in a flow of oxygen, compared with annealing in a flow of nitrogen. We confirmed the effect of activation annealing in oxygen flow on the performance of UV light‐emitting diode (LED). At a DC current of 100 mA, the output power of the LED annealed in oxygen flow at 900 °C is four times higher than that of the LED annealed in nitrogen flow at 800 °C.