We derive an effective spin Hamiltonian starting from the three-band m
odel for the CuO2 planes in high temperature superconductors. The coup
ling between the copper spins and the oxygen orbitals is eliminated us
ing two subsequent canonical transformations. As a result, the copper
spins interact via an ordinary superexchange and an effective RKKY int
eraction, which increases with doping. The resulting frustration of ma
gnetic interactions explains the suppression of antiferromagnetic long
-range order upon doping.