Motor control is a fundamental process that underlies all voluntary behavioral responses. Several different theories based on different principles (task dynamics, equilibrium-point theory, passive-motion paradigm, active inference, optimal control) account for specific aspects of how actions are produced, but fail to provide a unified view on this problem. Here we propose a concise theory of motor control based on three principles: optimal feedback control, control with a receding time horizon, and task representation by a series of via-points updated at fixed frequency. By construction, the theory provides a suitable solution to the degrees-of-freedom problem, i.e. trajectory formation in the presence of redundancies and noise. We show through computer simulations that the theory also explains the production of discrete, continuous, rhythmic and temporally-constrained movements, and their parametric and statistical properties (scaling laws, power laws, speed/accuracy tradeoffs). The theory has no free parameters and only limited variations in its implementation details and in the nature of noise are necessary to guarantee its explanatory power.