Control over all internal and external degrees of freedom of molecules at the level of single quantum states will enable a series of fundamental studies in physics and chemistry 1,2 . In particular, samples of ground-state molecules at ultralow temperatures and high number densities will facilitate new quantum-gas studies 3 and future applications in quantum information science 4 . However, high phase-space densities for molecular samples are not readily attainable because efficient cooling techniques such as laser cooling are lacking. Here we produce an ultracold and dense sample of molecules in a single hyperfine level of the rovibronic ground state with each molecule individually trapped in the motional ground state of an optical lattice well. Starting from a zero-temperature atomic Mott-insulator state 5 with optimized double-site occupancy 6 , weakly bound dimer molecules are efficiently associated on a Feshbach resonance 7 and subsequently transferred to the rovibronic ground state by a stimulated four-photon process with >50% efficiency. The molecules are trapped in the lattice and have a lifetime of 8 s. Our results present a crucial step towards Bose-Einstein condensation of groundstate molecules and, when suitably generalized to polar heteronuclear molecules, the realization of dipolar quantumgas phases in optical lattices [8][9][10] .Recent years have seen spectacular advances in the field of atomic quantum gases. Ultracold atomic samples have been loaded into optical lattice potentials, enabling the realization of strongly correlated many-body systems and the direct observation of quantum phase transitions with full control over the entire parameter space 5 . Molecules with their higher level of complexity are expected to have a crucial role in future-generation quantumgas studies. For example, the long-range dipole-dipole force between polar molecules gives rise to nearest-neighbour and next-nearest-neighbour interaction terms in the extended BoseHubbard Hamiltonian and should thus lead to unusual many-body states in optical lattices in the form of striped, checkerboard and supersolid phases [8][9][10] .An important prerequisite for all proposed molecular quantumgas experiments is the capability to fully control all internal and external quantum degrees of freedom of the molecules. For radiative and collisional stability, the molecules need to be prepared in their rovibronic ground state, that is, the lowest vibrational and rotational level of the lowest electronic state, and preferably in its energetically lowest hyperfine sublevel. As a starting point for the realization of new quantum phases, the molecular ensemble should be in the ground state of the many-body system. Such state control is possible only at ultralow temperatures and sufficiently high particle densities. Although versatile non-optical cooling and slowing techniques have recently been developed for molecular ensembles 11 and photo-association experiments with atoms in magneto-optical traps have reached the rovibrational ground sta...