We prove that a locally compact space with an upper curvature bound is a topological manifold if and only if all of its spaces of directions are homotopy equivalent and not contractible. We discuss applications to homology manifolds, limits of Riemannian manifolds and deduce a sphere theorem.