First-principles calculations of the energy of various crystal structures of Fe, Ni and ordered Fe–Ni compounds with different stoichiometries have been performed by the linearized augmented plane wave (LAPW) method in the generalized gradient approximation. The most stable compounds are L1 2–Ni 3Fe, L1 0–FeNi, C11 f–Ni 2Fe and C11 f–Fe 2Ni. The L1 2–Ni 3Fe compound has the largest negative formation energy, which is consistent with the experimental Fe–Ni phase diagram. The L1 0–FeNi compound has also been observed experimentally in meteorite samples as a metastable phase. It is suggested here that the C11 f compounds could also form in Fe–Ni alloys at low temperatures. A new semi-empirical interatomic potential has been developed for the Fe–Ni system by fitting to experimental data and the results of the LAPW calculations. Recognizing the significance of the covalent component of bonding in this system, the potential is based on the embedded-atom method (EAM) but additionally includes a bond-angle dependence. In comparison with the existing modified EAM method, our potential form is simpler, extends interactions to several (3–5) coordination shells and replaces the screening procedure by a smooth cutoff of the potential functions. The potential reproduces a variety of properties of Fe and Ni with a reasonable accuracy. It also reproduces all stability trends across the Fe–Ni system established by the LAPW calculations. The potential can be useful in atomistic simulations of the phases of the Fe–Ni system.