A p-MgZnO/i-ZnO/n-MgZnO light-emitting diode was fabricated on a GaAs substrate by metal–organic chemical vapour deposition. The I–V curve of the device exhibited typical rectifying behaviour of the p–i–n diode and the forward turn-on voltage was about 7 V. An obvious ultraviolet peak can be observed in the electroluminescence spectrum corresponding to the radiative recombination of carriers. The dependences of the characteristics on the thickness of the ZnO interlayer were also studied. The results showed that the intensity of the UV peak increased as the thickness of the ZnO layer decreased. A clear blue shift can also be observed at the same time. The thickness of the ZnO layer had an important effect on the optical qualities of the device.