Tetrapods are four-limbed (with a few exceptions, such as snakes) animals constituting the superclass Tetrapoda. It includes extant and extinct amphibians, reptiles (including dinosaurs and therefore birds), and mammals. Tetrapods evolved from a group of animals known as the Tetrapodomorpha which, in turn, evolved from ancient Sarcopterygii (lobe-finned fishes) around 390 million years ago in the middle Devonian period; their forms were transitional between lobe-finned fishes and the four-limbed tetrapods. The first tetrapods (from a traditional, apomorphy-based perspective) appeared by the late Devonian, 367.5 million years ago; the specific aquatic ancestors of the tetrapods, and the process by which they colonized Earth's land after emerging from water remains unclear. The change from a body plan for breathing and navigating in water to a body plan enabling the animal to move on land is one of the most profound evolutionary changes known. The first tetrapods were primarily aquatic. Modern amphibians, which evolved from earlier groups, are generally semiaquatic; the first stage of their lives is as fish-like tadpoles, and later stages are partly terrestrial and partly aquatic. However, most tetrapod species today are amniotes, most of those are terrestrial tetrapods whose branch evolved from earlier tetrapods about 340 million years ago (crown amniotes evolved 318 million years ago). The key innovation in amniotes over amphibians is laying of eggs on land or having further evolved to retain the fertilized egg(s) within the mother.
Stegocephalia is a larger group equivalent to some broader uses of the word tetrapod, used by scientists who prefer to reserve tetrapod for the crown group (based on the nearest common ancestor of living forms). Such scientists use the term "stem-tetrapod" to refer to those tetrapod-like vertebrates that are not members of the crown group, including the tetrapodomorph fishes.
As is the case throughout evolutionary biology today, there is debate over how to properly classify the groups within Tetrapoda. Traditional biological classification sometimes fails to recognize evolutionary transitions between older groups and descendant groups with markedly different characteristics. For example, the birds, which evolved from the dinosaurs, are defined as a separate group from them, because they represent a distinct new type of physical form and functionality. In phylogenetic nomenclature, in contrast, the newer group is always included in the old. For this school of taxonomy, dinosaurs and birds are not groups in contrast to each other, but rather birds are a sub-type of dinosaurs.
The first tetrapods probably evolved in the Emsian stage of the Early Devonian from Tetrapodomorph fish living in shallow water environments. The very earliest tetrapods would have been animals similar to Acanthostega, with legs and lungs as well as gills, but still primarily aquatic and unsuited to life on land.
The oldest near-complete tetrapod fossils, Acanthostega and Ichthyostega, date from the second half of the Fammennian. Although both were essentially four-footed fish, Ichthyostega is the earliest known tetrapod that may have had the ability to pull itself onto land and drag itself forward with its forelimbs. There is no evidence that it did so, only that it may have been anatomically capable of doing so.
The diapsids (a subgroup of the sauropsids) began to diversify during the Triassic, giving rise to the turtles, crocodiles, and dinosaurs. In the Jurassic, lizards developed from other diapsids. In the Cretaceous, snakes developed from lizards and modern birds branched from a group of theropod dinosaurs. By the late Mesozoic, the groups of large, primitive tetrapod that first appeared during the Paleozoic such as temnospondyls and amniote-like tetrapods had gone extinct. Many groups of synapsids, such as anomodonts and therocephalians, that once comprised the dominant terrestrial fauna of the Permian, also became extinct during the Mesozoic; however, during the Jurassic, one synapsid group (Cynodontia) gave rise to the modern mammals, which survived through the Mesozoic to later diversify during the Cenozoic.
The inclusion of certain extinct groups in the crown Tetrapoda depends on the relationships of modern amphibians, or lissamphibians. There are currently three major hypotheses on the origins of lissamphibians. In the temnospondyl hypothesis (TH), lissamphibians are most closely related to dissorophoid temnospondyls, which would make temnospondyls tetrapods. In the lepospondyl hypothesis (LH), lissamphibians are the sister taxon of lysorophian lepospondyls, making lepospondyls tetrapods and temnospondyls stem-tetrapods. In the polyphyletic hypothesis (PH), frogs and salamanders evolved from dissorophoid temnospondyls while caecilians come out of microsaur lepospondyls, making both lepospondyls and temnospondyls true tetrapods.
In Carboniferous tetrapods, the neck joint (occiput) provided a pivot point for the spine against the back of the skull. In tetrapodomorph fishes such as Eusthenopteron, no such neck joint existed. Instead, the notochord (a sort of spine made of cartilage) entered a hole in the back of the braincase and continued to the middle of the braincase. Acanthostega had the same arrangement as Eusthenopteron, and thus no neck joint. The neck joint evolved independently in different lineages of early tetrapods.