A curve ? in a Riemannian manifold M is three-dimensional if its torsion (signed second curvature function) is well-defined and all higher-order curvatures vanish identically. In particular, when ? lies on an oriented hypersurface S of M, we say that ? is well positioned if the curve's principal normal, its torsion vector, and the surface normal are everywhere coplanar. Suppose that ? is three-dimensional and closed. We show that if ? is a well-positioned line of curvature of S, then its total torsion is an integer multiple of 2p; and that, conversely, if the total torsion of ? is an integer multiple of 2p, then there exists an oriented hypersurface of M in which ? is a well-positioned line of curvature. Moreover, under the same assumptions, we prove that the total torsion of ? vanishes when S is convex. This extends the classical total torsion theorem for spherical curves.