The origin of magnetic anisotropy in magnetic compounds is a longstanding issue in materials science, and nonmagnetic ligand ions are considered to contribute little to magnetic anisotropy. Here, we introduce the concept of ligand-driven magnetic anisotropy in a complex transition-metal oxide. We conducted x-ray magnetic circular dichroism spectroscopies at the Ru and O edges in the 4d ferromagnetic metal SrRuO3. Systematic variation of the sample thickness in the range of ≤10 nm allowed us to control the localization of Ru 4d t2g states, which affects the magnetic coupling between the Ru and O ions. We observe that the orbital magnetic moment of the ligand O 2p orbitals induced through the charge transfer to the Ru 4d t2g states becomes anisotropic first, and the anisotropic magnetic moment of Ru and, therefore, the entire system is induced via magnetic coupling between Ru 4d and O 2p orbitals.