The present paper demonstrates the feasibility of X-ray absorption spectroscopy (XAS) and X-ray magnetic circular dichroism (XMCD) at high pressure at the Fe K edge on the ID24 energy-dispersive beamline of the ESRF. In 3d transition metals, performing experiments at the hard X-ray K edge rather than at the magnetically interesting soft X-ray L edges represents the only way to access the high-pressure regime obtainable with diamond anvil cells. The simultaneous availability of a local structure (XAS) and of a magnetic (XMCD) probe on the sample under identical thermodynamical conditions is essential for studying correlations between local structural and magnetic properties. The state-of-the-art theoretical understanding of K-edge XMCD data is briefly summarized, and the set-up of beamline ID24 for high-pressure XMCD experiments is illustrated and the conditions required to perform measurements at the K edges of 3d transition metals are underlined. Finally, two examples of recent high-pressure results at the Fe K edge in pure Fe and Fe3O4 powder are presented.