Galaxies grow inefficiently, with only a small percentage of the available gas converted into stars each free-fall time. Feedback processes, such as outflowing winds driven by radiation pressure, supernovae, or supermassive black hole accretion, can act to halt star formation if they heat or expel the gas supply. We report a molecular outflow launched from a dust-rich star-forming galaxy at redshift 5.3, 1 billion years after the Big Bang. The outflow reaches velocities up to 800 kilometers per second relative to the galaxy, is resolved into multiple clumps, and carries mass at a rate within a factor of 2 of the star formation rate. Our results show that molecular outflows can remove a large fraction of the gas available for star formation from galaxies at high redshift.