We present an exact decomposition of the complete wavefunction for a system of nuclei and electrons evolving in a time-dependent external potential. We derive formally exact equations for the nuclear and electronic wavefunctions that lead to rigorous definitions of a time-dependent potential energy surface (TDPES) and a time-dependent geometric phase. For the H + 2 molecular ion exposed to a laser field, the TDPES proves to be a useful interpretive tool to identify different mechanisms of dissociation. Treating electron-ion correlations in molecules and solids in the presence of time-dependent external fields is a major challenge, especially beyond the perturbative regime. To make numerical calculations feasible, the description usually involves approximations such as classical dynamics for nuclei with electron-nuclear coupling provided by Ehrenfest dynamics or surfacehopping [1], or even just static nuclei [2]. Quantum features of the nuclear dynamics (e.g., zero-point energies, tunneling, and interference) are included approximately in some methods [3,4], while numerically exact solutions of the time-dependent Schrödinger equation (TDSE) for the coupled system of electrons and nuclei have been given for very small systems like H + 2 [5]. Clearly, the full electron-nuclear wavefunction contains the complete information on the system, but it lacks the intuitive picture that potential energy surfaces (PES) can provide. To this end, approximate TDPES were introduced by Kono [6] as instantaneous eigenvalues of the electronic Hamiltonian, and proved extremely useful in interpreting system-field phenomena. The concept of a TDPES arises in a different way in Cederbaum's recent work, where the Born-Oppenheimer (BO) approximation is generalized to the time-dependent case [7].In the present Letter we provide a rigorous separation of electronic and nuclear motion by introducing an exact factorization of the full electron-nuclear wavefunction. The factorization is a natural extension of the work of Hunter [8], in which an exact decomposition was developed for the static problem. It leads to an exact definition of the TDPES as well as a Berry vector potential. Berry-Pancharatnam phases [9] are usually interpreted as arising from an approximate decoupling of a system from "the rest of the world", thereby making the system Hamiltonian dependent on some "environmental" parameters. For example, in the static BO approximation, the electronic Hamiltonian depends parametrically on the nuclear positions; i.e., the stationary electronic Schrödinger equation is solved for each fixed nuclear configuration R, yielding R-dependent eigenvalues (the BO PES) and eigenfunctions (the BO wavefunctions). If the total molecular wavefunction is approximated by a single product of a BO wavefunction and a nuclear wavefunction, the equation of motion of the latter contains a Berry-type vector potential. One may ask: is the appearance of Berry phases a consequence of the BO approximation or does it survive in the exact treatment? In this Letter we...