The nonlinear dynamics is investigated for a system of N classical spins. This represents a Hamiltonian system with N degrees of freedom. According to the Liouville theorem, the complete integrability of such a system requires the existence of N independent integrals of the motion which are mutually in involution. As a basis for the investigation of regular and chaotic spin motions, we have examined in detail the problem of integrability of a two-spin system. It represents the simplest autonomous spin system for which the integrability problem is nontrivial. We have shown that a pair of spins coupled by an anisotropic exchange interaction represents a completely integrable system for any values of the coupling constants. The second integral of the motion (in addition to the Hamiltonian), which ensures the complete integrability, turns out to be quadratic in the spin variables. If, in addition to the exchange anisotropy also single-site anisotropy terms are included in the two-spin Hamiltonian, a second integral of the motion quadratic in the spin variables exists and thus guarantees integrability, only if the model constants satisfy a certain condition. Our numerical calculations strongly suggest that the violation of this condition implies not only the nonexistence of a quadratic integral, but the nonexistence of a second independent integral of motion in general. Finally, as an example of a completely integrable N-spin system we present the Kittel-Shore model of uniformly interacting spins, for which we have constructed the N independent integrals in involution as well as the action-angle variables explicitly