Abstract. Magnesium (Mg) diffusion behavior on the band modulation of MgxZn1-xO/ZnO metal-semiconductor-metal photodetectors (MSM-PDs) was studied. As the annealing temperature increases, Mg atoms diffuse from MgxZn1-xO into the underlying ZnO layer, which modulates the detection band of the fabricated MSM-PDs from two distinct bands into one band. For the annealing temperature lower than 900 ºC, two detection bands were achieved located in the wavelength region of 280-320 nm and 360-400 nm, attributed to the absorption of the MgxZn1-xO and the ZnO layer, respectively. When the annealing temperature is raised to 900 ºC, the MgxZn1-xO/ZnO bi-layer becomes homogenized into a single MgxZn1-xO layer, leading to only one detection band with a wavelength region of 280-340 nm. In the photoluminescence measurement, the as-deposited MgxZn1-xO/ZnO bi-layer demonstrates two distinct emission peaks located at about 340 and 400 nm for the absorption of the MgxZn1-xO and ZnO layers, whereas only one emission peak of 355 nm was observed in the 900 ºC-annealed MgxZn1-xO/ZnO bi-layer.