The ideal photodetector is the one able to detect every single incoming photon. In particular, in X-ray medical imaging, the radiation dose for patients can then approach its fundamentally lowest limit set by the Poisson photon statistics. Such near-to-ideal X-ray detection characteristics have been demonstrated with only a few semiconductor materials such as Si1 and CdTe2; however, their industrial deployment in medical diagnostics is still impeded by elaborate and costly fabrication processes. Hybrid metal halide perovskites – newcomer semiconductors -– make for a viable alternative3,4,5 owing to their scalable, inexpensive, robust, and versatile solution growth and recent demonstrations of single gamma-photon counting under high applied bias voltages6,7. The major hurdle with perovskites as mixed electronic-ionic conductors, however, arises from the rapid material's degradation under high electric field8,9,10,11, thus far used in perovskite X-ray detectors12,13. Here we show that both near-to-ideal and long-term stable performance of perovskite X-ray detectors can be attained in the photovoltaic mode of operation at zero-voltage bias, employing thick and uniform methylammonium lead iodide (MAPbI3) single crystal (SC) films (up to 300 µm), solution-grown directly on hole-transporting electrodes. The operational device stability is equivalent to the intrinsic chemical shelf lifetime of MAPbI3, being at least one year in the studied case. Detection efficiency of 88% and noise equivalent dose of 90 pGyair (lower than the dose of a single incident photon) are obtained with 18 keV X-rays, allowing for single-photon counting, as well as low-dose and energy-resolved X-ray imaging. These findings benchmark hybrid perovskites as practically suited materials for developing low-cost commercial detector arrays for X-ray imaging technologies.