Herein, gallium nitride (GaN) samples implanted with magnesium (Mg) and fluorine (F) ions are investigated by photoluminescence (PL) measurements. In low‐temperature PL measurements, the characteristic green luminescence (GL) band attributable to nitrogen vacancies (VN) is observed in Mg‐ion‐implanted GaN. As VN are likely to act as donors, suppressing their formation is essential to realizing p‐type conductivity. The energy required for a F impurity to replace VN in GaN and eventually form F on a N site decreases when the Fermi level approaches the valence band maximum, and therefore F is employed as a subsequent implantation element to compensate for VN. The GL band peak disappears upon implanting Mg and F ions at a high temperature and adjusting the F concentration to an appropriate value. This result suggests that VN generated by Mg ion implantation can be suppressed using an element with a lower formation energy than that of VN.