A high sensitivity self-powered solar-blind photodetector is successfully constructed based on the polyaniline/MgZnO bilayer. The maximum responsivity of the photodetector is 160 μA W−1 at 250 nm under 0 V bias. The device also exhibits a high on/off ratio of ≈104 under 250 nm illumination at a relatively weak light intensity of 130 μW cm−2 without any power.