ZnO and its ternary alloy Mg x Zn 1Àx O (MZO) are promising wide-band-gap semiconductor materials well-suited to UV detection. The Mg content of MZO facilitates energy band gap engineering, enabling fabrication of UV photodetectors that can operate in the deep-UV region. Different types of UV photodetector based on ZnO have been reported, including photoconductive, Schottky, and transistor types. Transistor-based photodetectors have the advantage of being three-terminal devices, thus enabling biasing control and implementation in addressable arrays. In this paper we report an MZO thinfilm-transistor (TFT)-based UV photodetector. The device has a low dark current (2 9 10 À14 A) and an ON/OFF ratio of 10 11 . We show that by using a small amount of Mg (5%) in the MZO TFT we can substantially improve the photoresponse recovery time of the photodetector to 15 ms compared with 42 ms for a similar TFT with 0% Mg. We also observed a shift in the cutoff wavelength from 377.21 nm for the 0% Mg TFT photodetector down to 370.96 nm for the MZO TFT photodetector. We attribute the enhanced recovery time improvement of the MZO TFT UV photodetector to suppression of oxygen vacancies as a result of incorporation of the Mg in the MZO.