The first limbs were fish fins, not legs
It is tempting to imagine limbs as an invention of land-dwelling animals, but the fossil and anatomical evidence points the other way. Fish were the first animals to have limbs in the broad sense of fins, and the lobe-finned fish that gave rise to tetrapods already possessed fin skeletons with joints and digit-like elements [2]. In other words, the raw material for arms and legs was present in the water long before anything walked on land.
This matters because it reframes the question. The evolution of limbs was not a sudden leap from finless fish to legged land animal; it was a remodeling of existing fin structures. The transition from ancient lobe-finned fish to early tetrapods is best understood as a change in proportion, joint arrangement, and function of a limb that already existed in some form [1].
Why five toes, and why the answer is still unsettled
The five-toed, or pentadactyl, limb is the pattern shared by most living tetrapods, and it has long been a puzzle why this particular number became fixed. One recent analysis of the fish-to-tetrapod transition argues that the selection of five digits can be used to rewrite the theory of limb evolution, suggesting that the mechanism by which animals developed limbs was more constrained than a simple gradual addition of digits [1]. The scope of that claim is the fish-to-tetrapod transition specifically, not all limb-bearing animals.
The evidence does not yet settle whether five digits were favored by selection for function, by developmental constraints, or by some combination. What the comparative anatomy does show is that the joints and digits of vertebrate limbs underwent substantial transformation and differentiation across the transition, and that the pentadactyl pattern is the outcome of that remodeling rather than a starting point [1][2].
What was happening inside the limb bones
Limbs are not only about outer shape; the internal structure of limb bones changed too. In most tetrapods, limb bones produce blood cells, a process called haematopoiesis, but this is absent in the fin bones of ray-finned fish [4]. A study of fossil humeri from stem-tetrapods, batrachians, and amniotes found that Permian tetrapods appear to be among the first to show a centralized marrow organization that would allow blood cell production as seen in living amniotes [4].
That finding undercuts an earlier idea that blood cell production moved into long bones before the water-to-land transition as protection from harsh environmental conditions. Instead, the fossil evidence suggests that long-bone haematopoiesis was probably not an adaptation to land life, and that the functional acquisition of marrow came later in limb-bone evolution [4]. This is a good example of how a limb's story includes its internal tissues, not just its joints and digits.
Limbs as one novelty among many in early animals
Limbs did not evolve in isolation. The early evolution of animals during the Ediacaran–Cambrian diversification involved many new characters, and researchers distinguish between the potential to generate new forms and the actual appearance of new morphological features [3]. This framework suggests that developmental capacity can expand rapidly without immediately producing new visible structures, which is a useful reminder that the capacity for limbs may have preceded limbs themselves [3].
That broader context does not directly explain limb origins, but it cautions against treating limbs as a single sudden invention. The evidence is consistent with a picture in which the developmental and anatomical groundwork for limbs was laid gradually, and the fin-to-limb transition was one expression of that deeper capacity [1][3].
Sources used in this answer
The Evolution of the Polydactyl Limbs of Ancient Lobe-Finned Fish into the Five-Toed Limbs of Early Tetrapods: Why Do We Have Five Fingers on Our Hands?
The transition from lobe-finned fish fins to five-toed tetrapod limbs involved selection of five digits, and this can be used to revise the theory of limb evolution.
Biomorphology, transformation, and differentiation of joints and digits of the limbs in vertebrates
Fish were the first animals to have limbs (fins), and vertebrate limb joints and digits underwent evolutionary transformation and differentiation.
Developmental capacity and the early evolution of animals
Early animal evolution involved developmental novelties that expanded the capacity to generate morphologies, sometimes without immediately producing new visible structures.
New light shed on the early evolution of limb-bone growth plate and bone marrow
Permian tetrapods appear to be among the first to show centralized marrow organization allowing haematopoiesis, suggesting long-bone blood cell production was probably not an adaptation to the water-to-land transition.
Limb Preference in Animals: New Insights into the Evolution of Manual Laterality in Hominids
Limb preference and manual laterality in animals are linked to genetic, developmental, and brain factors, with different lateralization for object manipulation versus actions directed at living targets.
