Dilute GaAsN layers are grown by liquid phase epitaxy from saturated melts containing polycrystalline GaN as the source of nitrogen. From photoluminescence measurements the nitrogen content in the material is obtained. Low temperature photocurrent and photocapacitance measurements reveal the presence of an electron trap with an ionization energy of 0.65-0.67 eV in the as-grown layers, whose origin is related to interstitial (N-N)As defects. High temperature annealing of the material almost removed the trap and new electron traps at 0.8 and 0.9 eV are produced. It is suggested that during the annealing process the (N-N)As defects, due to their lower energy of formation, are converted to more thermally stable (AsGa-NAs) or (AsN)As defects which might be the source of the new electron traps. High temperature treatment of the growth melt with erbium is found to remove nitrogen from the grown layer with complete annihilation of all the electron traps. © 2005 IOP Publishing Ltd.