The precise control of Mg concentration ([Mg]) in p-type GaN layers from 2.3 × 1016 to 2.0 × 1019 cm−3 was demonstrated by halide vapor phase epitaxy (HVPE) on n-type GaN (0001) freestanding substrates. [Mg] in GaN layers could be controlled well by varying the input partial pressure of MgCl2 formed by a chemical reaction between MgO solid and HCl gas under the thermodynamic equilibrium condition. In the sample with [Mg] of 2.0 × 1019 cm−3, a step-bunched surface was observed because the surface migration of Ga adatoms was enhanced by the surfactant effect of Mg atoms. The samples show high structural qualities determined from x-ray rocking curve measurements. The acceptor concentration was in good agreement with [Mg], indicating that almost all Mg atoms act as acceptors. The compensating donor concentrations in the samples were higher than the concentrations of Si, O, and C impurities. We also obtained the Mg acceptor level at a sufficiently low net acceptor concentration of 245 ± 2 meV. These results show that the HVPE method is promising for fabricating GaN vertical power devices, such as n-channel metal–oxide–semiconductor field-effect transistors.