The glass transition is the freezing of a liquid into a solid state without evident structural order. Although glassy materials are well characterized experimentally, the existence of a phase transition into the glass state remains controversial. Here, we present numerical evidence for the existence of a novel first-order dynamical phase transition in atomistic models of structural glass formers. In contrast to equilibrium phase transitions, which occur in configuration space, this transition occurs in trajectory space, and it is controlled by variables that drive the system out of equilibrium. Coexistence is established between an ergodic phase with finite relaxation time and a nonergodic phase of immobile molecular configurations. Thus, we connect the glass transition to a true phase transition, offering the possibility of a unified picture of glassy phenomena.