Mg-doped and In-Mg co-doped p-type GaN epilayers were grown in a low-pressure metal organic chemical vapor deposition technique. The effect of In doping on the p-GaN layer was studied through photoluminescence (PL), persistent photoconductivity (PPC), and transmission electron microscopy (TEM) at room temperature. For the In-doped p-GaN layer, the PL intensity increases significantly and the peak position shifts to 3.2 eV from 2.95 eV of conventional p-GaN. Additionally, In doping greatly reduces the PPC, which was very strong in conventional p-GaN. A reduction in the dislocation density is also evidenced upon In doping in p-GaN according to TEM images. The improved optical properties of the In-doped p-GaN layer are attributed to the high crystalline quality and to the active participation of incorporated Mg atoms.