The semipolar (11 2‾ 2) plane Mg-doped p-Al0.42Ga0.58N epi-layers were successfully deposited on (10 1‾ 0) m-plane sapphire substrates with metal organic chemical vapor deposition technology. The effects of Cp2Mg molar flow rate on the structural, optical, and electrical properties of p-Al0.42Ga0.58N epitaxial layer were extensively studied. The randomly distributed Mg atoms and/or clusters that partially covered the growth surface were verified to act as an island-like mask to block the propagation of dislocations along the growth direction, resulting in a significant improvement in the crystalline quality of the semipolar Mg-doped p-AlGaN epi-layers. Moreover, two emission peaks with novel behavior were observed in the photoluminescence spectrum and identified to be originated from the transition between the conduction band and the Mg-related shallow acceptor energy level, and the deep Mg-induced compensation donor and the Mg acceptor pair-related transition, respectively. In addition, a hole concentration as high as 1.03 × 1017 cm−3 and a resistivity as low as 12.8 Ω cm were achieved for the semipolar Mg-doped p-Al0.42Ga0.58N epi-layer grown with the optimized Cp2Mg molar flow rate in this study.