Structural, magnetic and optical properties of Gd:GaN layers, which are grown by reactive molecular beam epitaxy (RMBE) with different Gd concentrations, are studied using X-ray diffraction (XRD), photoconductivity, photoluminescence (PL) spectroscopy and vibration sample magnetometry (VSM) techniques. Our study reveals that the incorporation of Gd produces a large concentration of acceptorlike defects in the GaN lattice. The defect band is found to be located ~ 450 meV above the valence band. Moreover, the concentration of defects in these layers is found to increase with the Gd concentration. Low temperature PL measurements show the existence of a broad luminescence band appearing at ~ 3.1 eV in all Gd doped GaN layers. The band comprises of several features. However, only one peak that is located at 3.05 eV diminishes substantially upon annealing as compared to the other features and at the same time the saturation magnetization is also found to decrease. The structural and magnetic properties of Gd implanted GaN layers were also investigated as a function of the annealing temperature. A clear correlation between the saturation magnetization and defect density was observed in these layers.