Hydrogen (H) and sulfur (S) are light element candidates to enter the core of planetary bodies. Although Fe-S and Fe-H systems have been studied individually, the Fe-S-H ternary system has only been investigated up to 16 GPa and 1723 K. We have investigated the Fe-S-H system at pressures and temperatures (P-T) relevant to the cores of Mars-sized planets (up to 45 GPa and well above the melting temperature of FeS) in the laser-heated diamond anvil cell combined with in situ synchrotron X-ray diffraction. We found that at high P-T, Fe3S is unstable if H exists in the system. Instead, separate Fe–H and Fe–S phases appear at 23–35 GPa. At pressures above 35 GPa, we found a new phase appearing while Fe–S phases disappear and Fe–H phases remain. Our analysis indicates that the new phase likely contains both S and H in the crystal structure (tentatively FeSH). The observed pressure dependent changes in the phase relation may be important for understanding the structure and dynamics of the Martian core and the cores of Mars-sized exoplanets.