P-type doping in wide bandgap and new classes of ultra-wide bandgap materials has long been a scientific and engineering problem. The challenges arise from the large activation energy of dopants and high densities of dislocations in materials. We report here, a significantly enhanced p-type conduction using high-quality AlGaN nanowires. For the first time, the hole concentration in Mg-doped AlGaN nanowires is quantified. The incorporation of Mg into AlGaN was verified by correlation with photoluminescence and Raman measurements. The open-circuit potential measurements further confirmed the p-type conductivity; while Mott-Schottky experiments measured a hole concentration of 1.3×1019 cm-3. These results from photoelectrochemical measurements allow us to design prototype ultraviolet (UV) light-emitting diodes (LEDs) incorporating the AlGaN quantum-disks-in-nanowire and optimized p-type AlGaN contact layer for UV-transparency. The ~335-nm LEDs exhibited a low turn-on voltage of 5 V with a series resistance of 32 Ω, due to the efficient p-type doping of the AlGaN nanowires. The bias-dependent Raman measurements further revealed the negligible self-heating of devices. This study provides an attractive solution to evaluate electrical properties of AlGaN, which is applicable to other wide bandgap nanostructures. Our results are expected to open doors to new applications for wide and ultra-wide bandgap materials.