Contrary to cats and primates, cortical contribution to hindlimb locomotor movements is not critical in rats. However, the importance of the motor cortex to regain locomotion after neurological disorders in rats suggests that cortical engagement in hindlimb motor control may depend on the behavioral context. To investigate this possibility, we recorded whole-body kinematics, muscle synergies, and hindlimb motor cortex modulation in freely moving rats performing a range of natural locomotor procedures. We found that the activation of hindlimb motor cortex preceded gait initiation. During overground locomotion, the motor cortex exhibited consistent neuronal population responses that were synchronized with the spatiotemporal activation of hindlimb motoneurons. Behaviors requiring enhanced muscle activity or skilled paw placement correlated with substantial adjustment in neuronal population responses. In contrast, all rats exhibited a reduction of cortical activity during more automated behavior, such as stepping on a treadmill. Despite the facultative role of the motor cortex in the production of locomotion in rats, these results show that the encoding of hindlimb features in motor cortex dynamics is comparable in rats and cats. However, the extent of motor cortex modulations appears linked to the degree of volitional engagement and complexity of the task, reemphasizing the importance of goal-directed behaviors for motor control studies, rehabilitation, and neuroprosthetics.