Tetrapods are a monophyletic (descending from a common ancestor) group of land animals that evolved approximately 365 million years ago from lobe-finned fish called sarcopterygians. It is thought that tetrapods evolved incrementally from fish adapted to swim through weed-choked swamps. These fish evolved muscular lower fins, when they used to navigate these swamps, which eventually developed into full-fledged legs. Some of these early forms had numerous digits, unlike the five or fewer digits common to so many tetrapods today.
The earliest tetrapods, called basal or stem tetrapods, such as the species Acanthostega, are more primitive than the common ancestor of all tetrapods alive today, and so do not fall into any of the main tetrapod groups. There are only a few dozen species in this classification, and they are all long extinct.
Aside from the basal tetrapods, there are three major groups of tetrapods: amphibians, synapsids (meaning "fused arch," mammals are the only synapsids alive today), and sauropsids (meaning "lizard face"). These groups are all monophyletic except for the possible exception of amphibians; some researchers suspect that salamanders may have evolved from an ancient amphibian more primitive than the common ancestor of all other living amphibians. Another name for synapsids is theropsid, which means "beast face", and another name for the sauropsids is "reptiles."
Both synapsids and sauropsids are amniotes, meaning the fetal forms are nurtured by a complex series of nutrients and membranes until they mature enough to breathe air and walk the world independently. For synapsids, this involves a womb (placental mammals) or a pouch (marsupials). Sauropsids lay eggs. Synapsids and sauropsids are thought to have evolved from amphibians at around the same time, around 320 million years ago, during the Carboniferous period. Hylonomus is the earliest confirmed reptile as of this writing, while Archaeothyris is the earliest synapsid. Both resembled small lizards, and were dwarfed by the large amphibians which dominated terrestrial ecosystems at the time. It wasn't until after an ice age near the end of the Carboniferous that some of the large amphibians began to die out and synapsids and sauropsids increased in size to fill vacant niches.