Classical mechanics is formulated as a kind of deterministic optimal control. The simplest, from the optimal control point of view, stochastic generalization of classical mechanisms is submitted. The connections between stochastic mechanics and quantum mechanics are shown, thanks to the stochastic optimal control method.