For tens of millions of years, during the Carboniferous and early Permian, amphibia were top predators on land, especially in the low-lying tropical river systems. In drier conditions, they were less effective, and the ancestors of mammals and reptiles (the Synapsids and Sauropsids) gradually took over the land. They laid cleidoic eggs, which had hard shells, and could be laid out of water. Most of the early large amphibians went extinct in the Triassic period; a few survived to the Lower Cretaceous.