Sluggish charge transfer dynamics are still the key issue limiting the development of photocatalysis. In this study, CdS/ZnIn2S4/MIL-53-NH2 ternary hierarchical heterostructures were constructed via a building block approach, where ZnIn2S4 lamellae first grow on MIL-53-NH2 followed by CdS nanoparticle deposition. The favorable interfacial compatibility and ternary heterostructures contribute to rapid and multistep spatial charge transfer, which suppresses charge recombination. Therefore, ultrahigh H2O2 production of 1792 μmol·L−1 was obtained over CdS/Znln2S4/MIL-53-NH2 composites with visible light, pure water and ambient air, which is not only higher than that of each monomer and binary heterostructure but also better than those of most reported references. Notably, the apparent quantum yield reached 4.5 % at 400 nm, and the solar-to-H2O2 conversion efficiency was 0.081 % in pure water and ambient air. Additionally, H2O2 generation over CdS/Znln2S4/MIL-53-NH2 composites involves two-electron O2 reduction with ·O2- as an intermediate. This work may encourage heterostructure design for efficient photocatalytic H2O2 production.