Light-emitting diodes (LEDs) based on p-GaN/ZnO heterojunction were fabricated. GaN was deposited on sapphire using metal-organic chemical vapor deposition (MOCVD), and two kinds of ZnO i.e. ZnO thin film deposited by sputtering and ZnO nanorods (NRs) grown by hydrothermal method were used as n-type layer respectively. MgO film with the thickness around 10 nm was deposited by electron-beam deposition to act as an interlayer between GaN and ZnO. Photoluminescence, electroluminescence and I-V curves were measured to compare the properties of GaN based heterojunction LEDs with different architectures. The existence of MgO interlayer as well as the morphology of ZnO obviously influenced the electrical and optical properties of GaN based LEDs. The effect of MgO interlayer on ZnO growth, properties and I-V curves and emission spectra of LEDs is discussed in detail.