In Gallium Nitride (GaN) implanted with a small amount of magnesium (Mg), scientists succeeded for the first time in visualizing the distribution and optical behavior of the implanted Mg at the nanoscale which may help in improving electrical performance of GaN based devices. Some of the mechanisms by which introduced Mg ions convert GaN into a p-type semiconductor are also revealed. These findings may significantly expedite the identification of optimum conditions for Mg implantation vital to the mass production of GaN power devices.