Light elements such as oxygen in Earth's core influence the physical properties of the iron alloys that exist in this region. Describing the high-pressure behavior of these materials at core conditions constrains models of core structure and dynamics. From x-ray diffraction measurements of iron monoxide (FeO) at high pressure and temperature, we show that sodium chloride (NaCl)-type (B1) FeO transforms to a cesium chloride (CsCl)-type (B2) phase above 240 gigapascals at 4000 kelvin with 2% density increase. The oxygen-bearing liquid in the middle of the outer core therefore has a modified Fe-O bonding environment that, according to our numerical simulations, suppresses convection. The phase-induced stratification is seismologically invisible but strongly affects the geodynamo.