We use the spin-fermion model to describe the CuO$_2$ planes of the high-Tc superconductors. Using a large wavelength approach, we show that the ferromagnetic component of the Cu spin fluctuations couple to the oxygen holes producing a pairing interaction that leads to a superconducting gap whose symmetry is determined by the anisotropy of the Kondo interaction. We calculate Tc as a function of the hole concentration in a mean-field approximation and our numerical results are in good agreement with the experiments.