We present a nonlinear mean-field model of the solar interior dynamics and dynamo, which reproduces the observed cyclic variations of the global magnetic field of the Sun, as well as the differential rotation and meridional circulation. Using this model, we explain, for the first time, the extended 22-year pattern of the solar torsional oscillations, observed as propagation of zonal variations of the angular velocity from high latitudes to the equator during the time equal to the full dynamo cycle. In the literature, this effect is usually attributed to the so-called extended solar cycle. In agreement with the commonly accepted idea our model shows that the torsional oscillations can be driven by a combinations of magnetic field effects acting on turbulent angular momentum transport, and the large-scale Lorentz force. We find that the 22-year pattern of the torsional oscillations can result from a combined effect of an overlap of subsequent magnetic cycles and magnetic quenching of the convective heat transport. The latter effect results in cyclic variations of the meridional circulation in the sunspot formation zone, in agreement with helioseismology results. The variations of the meridional circulation together with other drivers of the torsional oscillations maintain their migration to the equator during the 22-year magnetic cycle, resulting in the observed extended pattern of the torsional oscillations.