Modern crocodiles mostly just lounge around near river banks and wait to lunge at prey using their short, splayed legs. However, crocs that co-existed with dinosaurs did everything from stalk prey on land to ply the ancients seas.

Baurusuchus, for example, prowled the grasslands of South America on dog-like legs in the Cretaceous period, the last portion of the age of dinosaurs known as the Mesozoic era. In the earlier Triassic period, a one-foot long croc, named Erpetosuchus, may have occasionally walked on two legs.

SEE ALSO: Where We Live Dictates Who We Are: Why?

In the oceans, Steneosaurus lived like a dolphin, pursuing prey with it’s long, toothy snout. Another sea-going croc, Stomatosuchus, had a pelican-like mouth pouch that may have allowed the croc to feed on plankton and krill like a baleen whale.

These ancient crocodiles shared the ancient world with the likes of T-rex and Megalosaurus. Despite that colossal competition, the crocs thrived in an even wider variety of environments than today. A team of veterinarians and paleontologists found one of the secret to the crocs’ success in the animals’ evolutionarily adaptable jaws.

“Their evolution and anatomical variation during the Mesozoic Era was exceptional,” said lead study author Tom Stubbs  of the University of Bristol in a press release. “They evolved lifestyles and feeding ecologies unlike anything seen today.”

NEWS: America’s Invasive Species 450 Million Years Ago

Crocodilians reached a peak of diversity after the same extinction event at the end of the Triassic period (200 million years ago) that ushered in the age of the Jurassic giants like diplodocus and stegosaurus.

“Our results show that the ability to exploit a variety of different food resources and habitats, by evolving many different jaw shapes, was crucial to recovering from the end-Triassic extinction and most likely contributed to the success of Mesozoic crocodiles living in the shadow of the dinosaurs,” said Stubbs.

After the Triassic extinctions, crocs evolved jaw shapes that helped them slip efficiently through ocean waves, as well as snouts adapted to hunting on land.

Stubbs and his team analyzed more than 100 ancient crocodiles’ jaws. Their results were published in the Proceedings of Royal Society B.

IMAGE: A fossilized crocodile (Ghedoghedo, Wikimedia Commons)