The effect of electron irradiation on the optical properties of GaN epilayers is studied in detail by photoluminescence (PL) spectroscopy. The most common types of GaN material are used, i.e. strained heteroepitaxial layers grown on 6H SiC or Al2O3 substrates, and thick bulk-like layers with the conductivity varying from n-type to semi-insulating and p-type. The main effects of electron irradiation on all investigated samples are found to be as follows: (i) a radiation-induced quenching of excitonic emissions in the near band gap region; (ii) an appearance of broad overlapping PL emissions within the spectral range 0.7-1.1eV and (iii) the appearance of a PL band with a sharp no-phonon (NP) line at around 0.88eV followed by a rich phonon assisted sideband. The 0.88eV band is shown to originate from an internal transition of a deep defect. With increasing temperature a hot PL line can be observed at about 2-4meV above the NP line, originating from higher lying excited states of the defect. The electronic structure of the 0.88eV defect is shown to be very sensitive to the internal strain field in the GaN epilayers.