  We show that if $n$ functionally independent commutative quadratic in momenta
integrals for the geodesic flow of a Riemannian or pseudo-Riemannian metric on
an $n$-dimensional manifold are simultaneously diagonalisable at the tangent
space to every point, then they come from the St\"ackel construction, so the
metric admits orthogonal separation of variables.
