The archosaurs ('ruling reptiles') were the direct ancestors of the dinosaurs. They evolved from more primitive reptiles in the Triassic, following the Permian mass extinction. The evolution of the archosaurs is a very significant event in the history of life on land, since they not only led to the evolution of dinosaurs and birds, but also to the pterosaurs and crocodiles.

The early archosaurs took over the habitats left vacant by the large herbivores and carnivores that died out at the end of the Permian. Early forms such as the carnivore Proterosuchus (about 1m long) had a sprawling walk (similar to modern lizards). Some archosaurs such as Vjushkovia and Erythrosuchus were large carnivores (up to 5m long) with a more erect gait, that fed on other large plant-eating reptiles.

Later in their evolution, the archosaurs split into two 'branches' on the evolutionary tree. This split occurred in the middle to late Triassic period (about 220 million years ago). One of these branches led to the evolution of the crocodiles, while the other led to the evolution of the dinosaurs and birds. It has been suggested that the evolution of the dinosaurs from archosaurs was related to changes in the way the beasts moved, from a sprawling walk similar to lizards, to a semi-erect posture as in modern crocodiles, to the fully erect stance of the dinosaurs.