Planetary habitability, as we experience on Earth, is linked to a functioning geodynamo which is in part driven by the crystallization of the liquid iron-nickel-alloy core as a planet cools over time. Cosmochemical considerations suggest that sulfur is a candidate light alloying element in rocky planetary cores of varying sizes and oxidation states; such that, iron sulfide phase relations at extreme conditions contribute to outer core thermochemical convection and inner core crystallization of a wide range of planetary bodies. Here we experimentally investigate the structural properties of the Fe-S system and report the discovery of the sulfide, Fe5S2, crystallizing in equilibrium with iron at Earth’s outer core pressures and high temperatures. Using single-crystal X-ray diffraction techniques, Fe5S2 was determined to adopt the complex Ni5As2-type structure (P63cm, Z = 6). These results conclude that Fe5S2 is likely to crystallize at the interface of Earth’s core and mantle and will begin to crystallize during the freezing out of Earth and Venus’ core overtime. The increased metal-metal bonding measured in Fe5S2 compared to the other high P-T iron sulfides may contribute to signatures of higher conductivity from regions of Fe5S2 is crystallization. Fe5S2 could serve as a host for Ni and Si as has been observed in the related meteoritic phase, perryite, (Fe, Ni)8(P, Si)3, adding intricacies to elemental partitioning during inner core crystallization. The stability of Fe5S2 presented here is key to understanding the role of sulfur in the multicomponent crystallization sequences that drive the geodynamics and dictate the structures of Earth and rocky planetary cores.