Coherent manipulation of quantum systems with light is expected to be a cornerstone of future information and communication technology, including quantum computation and cryptography. The transfer of an optical phase onto a quantum wavefunction is a defining aspect of coherent interactions and forms the basis of quantum state preparation, synchronization and metrology. Light-phase-modulated electron states near atoms and molecules are essential for the techniques of attosecond science, including the generation of extreme-ultraviolet pulses and orbital tomography. In contrast, the quantum-coherent phase-modulation of energetic free-electron beams has not been demonstrated, although it promises direct access to ultrafast imaging and spectroscopy with tailored electron pulses on the attosecond scale. Here we demonstrate the coherent quantum state manipulation of free-electron populations in an electron microscope beam. We employ the interaction of ultrashort electron pulses with optical near-fields to induce Rabi oscillations in the populations of electron momentum states, observed as a function of the optical driving field. Excellent agreement with the scaling of an equal-Rabi multilevel quantum ladder is obtained, representing the observation of a light-driven 'quantum walk' coherently reshaping electron density in momentum space. We note that, after the interaction, the optically generated superposition of momentum states evolves into a train of attosecond electron pulses. Our results reveal the potential of quantum control for the precision structuring of electron densities, with possible applications ranging from ultrafast electron spectroscopy and microscopy to accelerator science and free-electron lasers.