The development of lead halide perovskite X-ray detectors has promising applications in medical imaging and security inspection but is hindered by poor long-term stability and drift of the dark current and photocurrent. Herein, we design a (Cs 0.05 MA 0.65 FA 0.3 )-PbI 3 -(Cs 0.1 MA 1.3 FA 0.6 )AgBiI 6 double-layer perovskite film to assemble a self-powered flat-panel X-ray detector. The demonstrated X-ray detector achieves an outstanding self-powered sensitivity of 80 μC Gy air −1 cm −2 under a 0 V bias. More importantly, owing to the inhibition of the phase transition process and ion migration of (Cs 0.05 MA 0.65 FA 0.3 )PbI 3 by the (Cs 0.1 MA 1.3 FA 0.6 )AgBiI 6 layer, the device exhibits excellent continuous operating stability with a retention rate of 99% dark current and photocurrent over X-ray pulses of up to 4000 s and excellent long-term stability without a loss of the original response current after 150 days in an air environment. The strategy of double-layer perovskites improves the stability and sensitivity of devices, which paves a path for the industrial application of lead halide perovskite X-ray detectors.