To move the body, the brain must precisely coordinate patterns of activity among diverse populations of motor neurons. In many species, including vertebrates, the motor neurons innervating a given muscle fire in a specific order that is determined by a gradient of cellular size and electrical excitability. This hierarchy allows premotor circuits to recruit motor neurons of increasing force capacity in a task-dependent manner. However, it remains unclear whether such a size principle also applies to species with more compact motor systems, such as the fruit fly, Drosophila melanogaster, which has just 53 motor neurons per leg. Using in vivo calcium imaging and electrophysiology, we found that genetically-identified motor neurons controlling flexion of the fly tibia exhibit a gradient of anatomical, physiological, and functional properties consistent with the size principle. Large, fast motor neurons control high force, ballistic movements while small, slow motor neurons control low force, postural movements. Intermediate neurons fall between these two extremes. In behaving flies, motor neurons are recruited in order from slow to fast. This hierarchical organization suggests that slow and fast motor neurons control distinct motor regimes. Indeed, we find that optogenetic manipulation of each motor neuron type has distinct effects on the behavior of walking flies.