Since the successful demonstration of a blue light-emitting diode (LED)1, potential materials for making short-wavelength LEDs and diode lasers have been attracting increasing interest as the demands for display, illumination and information storage grow2-4. Zinc oxide has substantial advantages including large exciton binding energy, as demonstrated by efficient excitonic lasing on optical excitation5,6. Several groups have postulated the use of p-type ZnO doped with nitrogen, arsenic or phosphorus7-10, and even p-n junctions11-13. However, the choice of dopant and growth technique remains controversial and the reliability of p-type ZnO is still under debate14. If ZnO is ever to produce long-lasting and robust devices, the quality of epitaxial layers has to be improved as has been the protocol in other compound semiconductors15. Here we report high-quality undoped films with electron mobility exceeding that in the bulk We have used a new technique to fabricate p-type ZnO reproducibly. Violet electroluminescence from homostructural p-i-n junctions is demonstrated at room-temperature.