In this paper we report on the first GaN p-n diodes fabricated by Mg ion implantation doping of n-type GaN epitaxial layers. Ion implantation was performed at room temperature. Implantation dose ranged from 1013 to 2×1016 cm−2. After implantation samples were annealed for 10-15 s at a wide temperature interval from 600°C to 1200°C in flowing N2 to form p-type layers. Secondary ion mass spectroscopy, scanning electron microscopy with electron beam induced current and back scattered electron modes as well as current-voltage and capacitance-voltage measurements were used to study structural and electrical characteristics of the Mg implanted p-n structures.