Crocodile-like animals appeared in the LateTriassic, like many of the large predators of the Mesozoic.True crocodiles did not appear until the Jurassic They were different in lifestyle and appearance to today's crocodiles. Proterosuchians were one of these early groups. They had longer legs than modern crocodiles and spent much more time on land. They would have been fast runners and the structure of the pelvic bones of some of these creatures indicates that they probably ran on two legs. The heavy armour on the back and legs had a second function other than protection. It stiffened the back and legs, helping them to support the crocodile's body whilst it roamed the land.In spite of this difference crocodiles have maintained a very similar body plan from the Late Triassic until the present day.
There were many large predators competing for niches during the Late Triassic. By adopting a semi-aquatic way of life crocodiles were able to establish themselves in a new niche. A move into the swamps would also have allowed them to escape the predatory attentions of the early dinosaurs and theocodonts. Although they are reptiles and need to return to the surface to breath air, they can remain underwater for a long time, allowing them to evade predators. This trick still helps them survive today, in an age of large mammal predators.
During the Jurassic period the crocodiles tried to move into the marine realms, but this group of sea crocodiles (thallatosuchians) died out quite quickly. Possibly they could not compete with the huge sea dragons of the Mesozoic seas. The largest crocodiles appeared in the Late Cretaceous. Deionsuchus ('terrible crocodile') had a skull 1.8m long. That is about the size of a person. Its total length was 12-15m. Lying in ambush such a beast could easily have killed dinosaurs when they came to drink at watering holes, just as they kill large mammals (including humans) today.