The structural and magnetic properties of Fe octaethylporphyrin (OEP) molecules on Cu(001) have been investigated by means of density functional theory (DFT) methods and X-ray absorption spectroscopy. The molecules have been adsorbed on the bare metal surface and on an oxygen-covered surface, which shows a √ 2 × 2 √ 2R45 • reconstruction. In order to allow for a direct comparison between magnetic moments obtained from sum-rule analysis and DFT we calculate the dipolar term 7 Tz , which is also important in view of the magnetic anisotropy of the molecule. The measured Xray magnetic circular dichroism shows a strong dependence on the photon incidence angle, which we could relate to a huge value of 7 Tz , e.g. on Cu(001) 7 Tz amounts to -2.07 µB for normal incidence leading to a reduction of the effective spin moment ms+7 Tz . Calculations have also been performed to study the influence of possible ligands such as Cl and O atoms on the magnetic properties of the molecule and the interaction between molecule and surface, because the experimental spectra display a clear dependence on the ligand, which is used to stabilize the molecule in the gas phase. Both types of ligands weaken the hybridization between surface and porphyrin molecule and change the magnetic spin state of the molecule, but the changes in the X-ray absorption are clearly related to residual Cl ligands.