Ultralow-velocity zones (ULVZs) at Earth’s core–mantle boundary region have important implications for the chemical composition and thermal structure of our planet, but their origin has long been debated. Hydrogen-bearing iron peroxide (FeO2Hx) in the pyrite-type crystal structure was recently found to be stable under the conditions of the lowermost mantle. Using high-pressure experiments and theoretical calculations, we find that iron peroxide with a varying amount of hydrogen has a high density and high Poisson ratio as well as extremely low sound velocities consistent with ULVZs. Here we also report a reaction between iron and water at 86 gigapascals and 2,200 kelvin that produces FeO2Hx. This would provide a mechanism for generating the observed volume occupied by ULVZs through the reaction of about one-tenth the mass of Earth’s ocean water in subducted hydrous minerals with the effectively unlimited reservoir of iron in Earth’s core. Unlike other candidates for the composition of ULVZs, FeO2Hx synthesized from the superoxidation of iron by water would not require an extra transportation mechanism to migrate to the core–mantle boundary. These dense FeO2Hx-rich domains would be expected to form directly in the core–mantle boundary region and their properties would provide an explanation for the many enigmatic seismic features that are observed in ULVZs.