The conditions of stability and stabilization of invariant sets of a dynamical system corresponding to its partial integrals are being determined. The solution of the control problem is presented as an inverse problem of dynamics. The requirement to limit deviations from the optimal trajectory is considered as a problem of stabilizing the constraints corresponding to the known integrals of the dynamical equations of a closed system. The conditions of stability of the optimal trajectory of a variable mass point in the central field of forces are established. Partial integrals of the dynamical equations of a closed system, determined by the known first integrals corresponding to the given initial conditions, are accepted as the constraint equations.