Despite many prior studies demonstrating offline behavioral gains in motor skills after sleep, the underlying neural mechanisms remain poorly understood. To investigate the neurophysiological basis for offline gains, we performed single-unit recordings in motor cortex as rats learned a skilled upper-limb task. We found that sleep improved movement speed with preservation of accuracy. These offline improvements were linked to both replay of task-related ensembles during non-rapid eye movement (NREM) sleep and temporal shifts that more tightly bound motor cortical ensembles to movements; such offline gains and temporal shifts were not evident with sleep restriction. Interestingly, replay was linked to the coincidence of slow-wave events and bursts of spindle activity. Neurons that experienced the most consistent replay also underwent the most significant temporal shift and binding to the motor task. Significantly, replay and the associated performance gains after sleep only occurred when animals first learned the skill; continued practice during later stages of learning (i.e., after motor kinematics had stabilized) did not show evidence of replay. Our results highlight how replay of synchronous neural activity during sleep mediates large-scale neural plasticity and stabilizes kinematics during early motor learning.