Researchers from Flinders University in Australia and University of Alberta in Canada compared computerised tomography (CT) scans of the inner ear of over 80 snake and lizard species with the remains of a primitive snake species called Dinilysia.
They discovered that ancient snakes may have been both adept swimmers - much like eels - and fearsome burrowers, like worms.
"The origin of snakes attracts a lot of controversy and this research helps us have a better understanding of how evolution works," said Alessandro Palci from Flinders University.
Over a century, researchers have vigorously argued whether snakes evolved their long bodies to be better at burrowing like worms or at swimming like eels, Xinhua news agency reported.
"Our new study suggests that both camps might have been partly right. There are striking resemblances between the inner ear region of the primitive snake Dinilysia and some semi-aquatic snakes, as well as certain burrowing forms," Palci said.
The findings confirmed that snakes evolved from being both land-dwelling and sea-dwelling creatures, said Mike Lee, professor at Flinders University.