The life of the crocodile's prehistoric relative, the Machimosaurus, has been revealed by a study of fossils from across Europe.
Edinburgh University researchers said the ancient crocodile group included a nine-metre long saltwater species that lived in open seas and fed on turtles.
Its closest relatives lived closer to shore.
Until now scientists were unsure whether more than one species of Machimosaurus existed.
However, the study has confirmed three distinct species which each adapted to enable them to live and hunt in a range of habitats, in the same way as modern-day crocodiles.
By examining fossils from museums across the continent, the team was able to determine key elements of the animals' anatomy and lifestyle.
They were found to vary in body length, skeleton, skull and lower jaw shape, and in their teeth.
Dr Mark Young, from Edinburgh University's school of geosciences, said: "Interesting parallels can be seen between groups of ancient crocodiles and those living today, with some able to swim out in the open sea, with others restricted to the coast.
"With more fossils being discovered, we look forward to learning more about this giant group of Jurassic predators."
The study is published in the journal Royal Society Open Science.