  Mn-doped wurtzite GaN epilayers have been grown by nitrogen plasma-assisted
molecular beam epitaxy. Correlated SIMS, structural and magnetic measurements
show that the incorporation of Mn strongly depends on the conditions of the
growth. Hysteresis loops which persist at high temperature do not appear to be
correlated to the presence of Mn. Samples with up to 2% Mn are purely
substitutional Ga$_{1-x}$Mn$_x$N epilayers, and exhibit paramagnetic
properties. At higher Mn contents, precipitates are formed which are identified
as GaMn$_3$N clusters by x-ray diffraction and absorption: this induces a
decrease of the paramagnetic magnetisation. Samples co-doped with enough Mg
exhibit a new feature: a ferromagnetic component is observed up to $T_c\sim175$
K, which cannot be related to superparamagnetism of unresolved magnetic
precipitates.
