Abstract Fe3P is a candidate component in planetary cores. We have investigated high-pressure behavior of Fe3P by first-principles calculations and synchrotron X-ray diffraction. Theoretical calculations reveal a magnetic collapse at 40–65 GPa, accompanied by a structural transition. The possible high-pressure polymorph is either a distorted cementite structure (Pnma) or a P4/mnc structure. By combining synchrotron X-ray diffraction and laser-heating diamond anvil cell techniques, we have collected in situ diffraction patterns of Fe3P up to 64 GPa and 1650 K. The high-pressure phase transition from I4¯ to P4/mnc structure predicted by the first-principles calculations was confirmed. Discontinuous variations of lattice constants and thermal expansion coefficients with pressure were observed around 17 and 40 GPa, indicating a possible magnetic transition developed in this range, which are in agreement with the calculated results.