We analytically determine the spatially varying spin-transfer torque within a domain wall. In the case of ballistic spin and diffusive charge transport, the spin-transfer torque as well as the local degree of nonadiabaticity oscillate within a domain wall. In narrow domain walls, the degree of nonadiabaticity ceases to be a constant material parameter but depends on the domain-wall width including a possible sign change, which is crucial for experiments and the technological utilization in spin-transfer-torque-based storage devices.