A local optimization algorithm for solving the Kohn-Sham equations is presented. It is based on a direct minimization of the energy functional under the equality constraints representing the Grassmann Manifold. The algorithm does not require an eigendecomposition, which may be advantageous in large-scale computations. It is optimized to reduce the number of Kohn-Sham matrix evaluations to one per iteration to be competitive with standard self-consistent field (SCF) approach accelerated by direct inversion of the iterative subspace (DIIS). Numerical experiments include a comparison of the algorithm with DIIS. A high reliability of the algorithm is observed in configurations where SCF iterations fail to converge or find a wrong solution corresponding to a stationary point different from the global minimum. The local optimization algorithm itself does not guarantee that the found minimum is global. However, a randomization of the initial approximation shows a convergence to the right minimum in the vast majority of cases.