Amniotes are animals who shield the embryos of their offspring using extensive membranes or keeping them inside the body, in contrast to most other animals, which lay free-floating eggs in water. Amniotes include mammals, reptiles, birds, and the extinct mammal-like reptiles (theropsids) and dinosaurs. Of all 38 animal phyla, only one has amniote members — Chordata, and even then, many chordates, which include fish, sharks, rays, and amphibians, are not amniotes. All non-amphibian tetrapods are amniotes, however.
Amniotes were nature's way of making large land animals that were truly terrestrial in the sense that they did not depend on pools of water as a medium for reproduction. Land animals existed long before amniotes, but mostly as insects. The first amniotes resembled small lizards, and are variously stated as emerging between 350 and 310 million years ago, during the Carboniferous period. Instead of laying eggs with hard shells, they were surrounded by a tough membrane. These early amniotes were also able to mate on land, a feature not possessed by amphibians. Prior to this, vertebrate animals, in the form of amphibians, only colonized the shores of ponds, lakes, oceans, and rivers, but never traveled very far inland. The emergence of amniotes signaled the eventual decline of amphibians and a flourishing of tetrapod megafauna on land.
One of the first reptilomorphs (reptile-like tetrapods) was Westlothiana, which bore a superficial resemblance to modern day lizards. Fossils of Westlothiana have been dated to 350 million years ago. Westlothiana features a mix of amphibian and amniote characteristics, and was originally considered a stem amniote, but some scientists have since put it outside of the amniote group. Westlothiana made headlines for being discovered along with other Carboniferous fossils in the walls surrounding a Scottish soccer field. Petrolacosaurus and Mesosaurus are other early tetrapods which have a reptilian look, although they were amphibians.
The Carboniferous was a time when true forests finally began to grow in fertile areas on the land, providing a prodigious source of food for any animal evolutionarily gifted enough to stray significant distances from standing water. Competition among amphibians in the regions around water would have progressively driven certain variants further and further away, until eventually some evolved the ability to wrap their eggs in a sturdy membrane. Everything happened incrementally, but within a few tens of millions of years there were animals laying rock-hard eggs in the middle of barren deserts.