Observing and controlling macroscopic quantum systems has long been a driving force in quantum physics research. In particular, strong coupling between individual quantum systems and mechanical oscillators is being actively studied1,2,3. Whereas both read-out of mechanical motion using coherent control of spin systems4,5,6,7,8,9 and single-spin read-out using pristine oscillators have been demonstrated10,11, temperature control of the motion of a macroscopic object using long-lived electronic spins has not been reported. Here we observe a spin-dependent torque and spin-cooling of the motion of a trapped microdiamond. Using a combination of microwave and laser excitation enables the spins of nitrogen–vacancy centres to act on the diamond orientation and to cool the diamond libration via a dynamical back-action. Furthermore, by driving the system in the nonlinear regime, we demonstrate bistability and self-sustained coherent oscillations stimulated by spin–mechanical coupling, which offers the prospect of spin-driven generation of non-classical states of motion. Such a levitating diamond—held in position by electric field gradients under vacuum—can operate as a ‘compass’ with controlled dissipation and has potential use in high-precision torque sensing12,13,14, emulation of the spin-boson problem15 and probing of quantum phase transitions16. In the single-spin limit17 and using ultrapure nanoscale diamonds, it could allow quantum non-demolition read-out of the spin of nitrogen–vacancy centres at ambient conditions, deterministic entanglement between distant individual spins18 and matter-wave interferometry16,19,20.