AlN materials have a wide range of applications in the fields of optoelectronic, power electronic, and radio frequency. However, the significant lattice mismatch and thermal mismatch between heteroepitaxial AlN and its substrate lead to a high threading dislocation (TD) density, thereby degrading the performance of device. In this work, we introduce a novel, cost-effective, and stable approach to epitaxially growing AlN. We inject different doses of nitrogen ions into nano patterned sapphire substrates, and then deposit the AlN layers by using metal-organic chemical vapor deposition. Ultraviolet light-emitting diode (UV-LED) with a luminescence wavelength of 395 nm is fabricated on it, and the optoelectronic properties are evaluated. Compared with the sample prepared by the traditional method, the sample injected with N ions at a dose of 1×10<sup>13</sup> cm<sup>–2</sup> exhibits an 82% reduction in screw TD density, the lowest surface roughness, and a 52% increase in photoluminescence intensity. It can be seen that appropriate dose of N ion implantation can promote the lateral growth and merging process in AlN heteroepitaxy. This is due to the fact that the process of implantation of N ions can suppress the tilt and twist of the nucleation islands, effectively reducing the density of TDs in AlN. Furthermore, in comparison with the controlled LED, the LED prepared on the high quality AlN template increases 63.8% and 61.7% in light output power and wall plug efficiency, respectively. The observed enhancement in device performance is attributed to the TD density of the epitaxial layer decreasing, which effectively reduces the nonradiative recombination centers. In summary, this study indicates that the ion implantation can significantly improve the quality of epitaxial AlN, thereby facilitating the development of high-performance AlN-based UV-LEDs.