Mg doping has been found in some situations to invert growth on Ga-face GaN to N-face. In this study, we clarified the role the Ga wetting layer plays in rf plasma molecular beam epitaxy of GaN when Mg doping, for [Mg] from similar to2 X 10(19) to similar to1 X 10(20) cm(-3) corresponding to the useful, accessible range of hole concentrations of p similar to 10(17)-10(18) cm(-3) Structures were grown in the N-rich and Ga-rich growth regime for single Mg doping layers and for multilayer structures with a range of Mg concentrations. Samples were characterized in situ by reflection high-energy electron diffraction and ex situ by atomic force microscopy, transmission electron microscopy, convergent beam electron diffraction, and secondary ion mass spectroscopy. Growth on "dry" surfaces (without a Ga wetting layer) in the N-rich regime completely inverted to N-face upon exposure to Mg. No reinversion to Ga-face was detected for subsequent layers. Additionally, Mg was seen to serve as a surfactant during this N-rich growth, as has been reported by others. Growth initiated in the Ga-rich regime contained inversion domains that nucleated with the initiation of Mg doping. No new inversion domains were found as the Mg concentration was increased through the useful doping levels. Thus the Ga wetting layer was found to inhibit nucleation of N-face GaN, though a complete wetting layer took time to develop. Finally, by establishing a complete Ga wetting layer on the surface prior to growth, we confirmed this finding and demonstrated Mg-doped GaN completely free from inversion domains to a doping level of [Mg] similar to2 X 10(20). (C) 2003 American Vacuum Society.