Oxygen-plasma treatment was employed on Mg x Zn1− x O surface with various treatment times (0–15 min) and metal-semiconductor-metal photodetectors (MSM-PDs) were fabricated. The leakage current of the MSM-PDs greatly decreased with treatment times. Before oxygen-plasma treatment, the MSM-PDs shows a less dependence of ultraviolet (UV) response with bias voltages; however, the visible response, originated from the absorption of defects, increases with bias voltages. After treatment, conversely, the MSM-PDs demonstrate a sharply increasing UV response with bias voltages; whereas, the visible response is independent with bias voltages. Such leads to 320/500-nm rejection ratio increases with bias voltages and a very high value of 168 at −80 V for the 10-min treated MSM-PDs, which is six times larger than that of MSM-PDs with as-deposited Mg x Zn1− x O film. X-ray photoelectron spectroscopy shows that with increasing treatment time, the number of oxygen atoms increase and compensate the oxygen vacancies on the Mg x Zn1− x O surface. Most of these oxygen atoms react with Mg atoms to build a highly stable passivation MgO film on Mg x Zn1− x O surface, the insulating MgO film forms a higher potential barrier between Au and Mg x Zn1− x O layer, hence greatly reducing the leakage current and enhancing the UV/visible rejection ratio in the oxygen-plasma treated MSM-PDs.