We consider the Cahn-Hilliard equation in one space dimension with scaling parameter epsilon, i.e., u(t) = (W'(u) - epsilon(2)u(xx))(xx), where W is a nonconvex potential. In the limit epsilon down arrow 0, under the assumption that the initial data are energetically well prepared, we show the convergence to a Stefan problem. The proof is based on variational methods and exploits the gradient flow structure of the Cahn-Hilliard equation.