In the Kondo effect, a localized magnetic moment is screened by forming a correlated electron system with the surrounding conduction electrons of a non-magnetic host 1 . Spin S = 1/2 Kondo systems have been investigated extensively in theory and experiments, but magnetic atoms often have a larger spin 2 . Larger spins are subject to the influence of magnetocrystalline anisotropy, which describes the dependence of the magnetic moment's energy on the orientation of the spin relative to its surrounding atomic environment 3,4 . Here we demonstrate the decisive role of magnetic anisotropy in the physics of Kondo screening. A scanning tunnelling microscope is used to simultaneously determine the magnitude of the spin, the magnetic anisotropy and the Kondo properties of individual magnetic atoms on a surface. We find that a Kondo resonance emerges for large-spin atoms only when the magnetic anisotropy creates degenerate ground-state levels that are connected by the spin flip of a screening electron. The magnetic anisotropy also determines how the Kondo resonance evolves in a magnetic field: the resonance peak splits at rates that are strongly direction dependent. These rates are well described by the energies of the underlying unscreened spin states.A low density of magnetic impurities in a non-magnetic host metal can have dramatic effects on the magnetic, thermodynamic and electrical properties of the material owing to the Kondo effect, a many-body interaction between the metal's conduction electrons and the electron spin of the localized magnetic impurity 5 . This interaction gives rise to a narrow, pronounced peak in the density of states close to the Fermi energy 1 . The past decade has seen a surge of interest in the Kondo screening of individual atomic spins, as a result of experimental advances in probing individual magnetic atoms by using scanning tunnelling microscopes 6,7 and single-molecule transistors 8,9 . When magnetic atoms are placed on metal surfaces the Kondo interaction between the localized spin and the conduction electrons is very strong, leading to high Kondo temperatures T K , in the range from 40 to 200 K (ref. 10). In order to probe the Kondo physics it is desirable to reduce this interaction so that the Kondo screening competes on an equal footing with external influences such as magnetic fields. It was shown recently that this can be achieved by incorporating a decoupling layer between the atomic spin and the screening conduction electrons 11 .