Seismic, geodetic and cosmochemical evidence point to Mars having a sulfur-rich liquid core. Due to the similarity between estimates of the core’s sulfur content and the iron - iron sulfide eutectic composition at core conditions, it has been concluded that temperatures are too high for Mars to have an inner core. Recent low density estimates for the core, however, appear consistent with sulfur contents that are higher than the eutectic composition, leading to the possibility that an inner core could form from a high-pressure iron sulfide phase. Here we report the crystal structure of a phase with the formula Fe4 + xS3, the iron content of which increases with temperature, approaching the stoichiometry Fe5S3 under Martian inner core conditions. We show that Fe4 + xS3 has a higher density than the liquid Martian core and that a Fe4 + xS3 inner core would crystalize if temperatures fall below 1960 (± 105) K at the center of Mars.