Marine predators that lived in deep waters during the Jurassic Period thrived as sea levels rose, while species that dwelled in the shallows died out, research suggests.
A study of fossilised teeth has shed light on how reptiles adapted to major environmental changes more than 150 million years ago, and how sea life might respond today.
It also reveals for the first time that the broad structure of food chains beneath the sea has remained largely unchanged since the Jurassic era.
For more than 18 million years, diverse reptile species lived together in tropical waters that stretched from present-day northern France to Yorkshire in the north of England.
Until now, however, little was known about the structure of the food chain in this region - called the Jurassic Sub-Boreal Seaway - or how it changed as sea levels rose.
By analysing the shape and size of teeth spanning this 18-million-year period when water levels fluctuated, palaeontologists at the University of Edinburgh found that species belonged to one of five groups based on their teeth, diet and which part of the ocean they inhabited.
The pattern is very similar to the food chain structure of modern oceans, where many different species are able to co-exist in the same area because they do not compete for the same resources, the team says.
As global sea levels rose, reptiles that lived in shallow waters and caught fish using thin, piercing teeth declined drastically, researchers found.
At the same time, larger species that inhabited deeper, open waters began to thrive. These reptiles had broader teeth for crunching and cutting prey.
Deep-water species may have flourished as a result of major changes in ocean temperature and chemical make-up that also took place during the period, the team says. This could have increased levels of nutrients and prey in deep waters, benefitting species that lived there.
The study offers insights into how species at the top of marine food chains today might respond to rapid environmental changes - including climate change, pollution and rising temperatures.
The study, which also involved the University of Bristol, is published in the journal Nature Ecology & Evolution. It was supported by the Leverhulme Trust, Marie Sk?odowska-Curie Actions, Systematics Research Fund, Palaeontographical Society and Palaeontological Association.
Davide Foffa, of the University of Edinburgh's School of GeoSciences, who led the study, said: "Studying the evolution of these animals was a real - and rare - treat, and has offered a simple yet powerful explanation for why some species declined as others prospered. This work reminds us of the relevance of palaeontology by revealing the parallels between past and present-day ocean ecosystems."
Dr Steve Brusatte, also of the University's School of GeoSciences, said: "Teeth are humble fossils, but they reveal a grand story of how sea reptiles evolved over millions of years as their environments changed. Changes in these Jurassic reptiles parallel changes in dolphins and other marine species that are occurring today as sea-levels rise, which speaks to how important fossils are for understanding our modern world."