A fossilised snake skull found in Argentina may have solved the mystery of how the animals lost their legs.

Rather than shed them to become better swimmers as they began to inhabit aquatic environments, the skull, from 90 million years ago, suggests legs became an evolutionary disadvantage as the ancestors of modern snakes wriggled into increasingly narrow burrows in pursuit of prey.

The research challenges the theory that snakes originally became limbless as they began to live in the sea. The secret of the lost limbs was revealed by an examination of the inner ear of Dinilysia patagonica, a two-metre long relative of the modern snake.

Using Computed Tomography (CT), scientists found a distinctive structure in its bony canals and cavities that was also turned out to be present in modern burrowing snakes and lizards.

But the structure, which may assist with the detection of prey and predators, was missing from snakes that live in water or above ground. Lead scientist Dr Hongyu Yi, from the University of Edinburgh’s School of GeoSciences, said: “How snakes lost their legs has been a mystery to scientists but it seems this happened when their ancestors became adept at burrowing.

“The inner ears of fossils can reveal a remarkable amount of information and are very useful when the exterior of fossils are too damaged or too fragile to examine.”

The findings, published in the journal Science Advances, confirm Dinilysia patagonica as the largest burrowing snake ever known.

Co-author Dr Mark Norell, from the American Museum of Natural History, said: “This discovery would not have been possible a decade ago. CT scanning has revolutionised how we can study ancient animals.

Snakes in hats Show all 8 1 /8 Snakes in hats Snakes in hats I look rather great in this very tiny top hat don't you think? Reddit/Imgur Reddit/Imgur Snakes in hats Merry Christmas! Just for you I'm tolerating wearing this ridiculous hat Reddit/Imgur Reddit/Imgur Snakes in hats Look at the time and effort my mum and dad put into creating my top hat! Reddit/Imgur Reddit/Imgur Snakes in hats Sun: come at me! I've got my hat! Reddit/Imgur Reddit/Imgur Snakes in hats Why have you put this party hat on my head? - I'm ready to sleep! Reddit/Imgur Reddit/Imgur Snakes in hats Do you like my sombrero? Reddit/Imgur Reddit/Imgur Snakes in hats Sorry snake, my sombrero is far superior Reddit/Imgur Reddit/Imgur Snakes in hats Ho ho ho! See how my green hat compliments my orange skin - I tried a red one but it clashed Reddit/Imgur Reddit/Imgur

“We hope similar studies can shed light on the evolution of more species, including lizards, crocodiles and turtles.”