Washington: Although snakes are found in a wide range of habitats, such as land, water and on trees, they first evolved on land and not in the sea as is popularly believed, says a new study.

The original snake ancestor was a nocturnal, stealth-hunting predator that had tiny hind limbs with ankles and toes, the researchers noted.

"While snake origins have been debated for a long time, this is the first time these hypotheses have been tested thoroughly using cutting-edge methods," said lead author Allison Hsiang from Yale University in the US.

"By analysing the genes, fossils and anatomy of 73 different snake and lizard species, both living and extinct, we have managed to generate the first comprehensive reconstruction of what the ancestral snake was like," Hsiang pointed out.

They most likely originated in the warm, forested ecosystems of the Southern Hemisphere around 128 million years ago. They most likely came from the ancient supercontinent of Laurasia, the study noted.

While many ancestral reptiles were most active during the daytime (diurnal), the ancestral snake is thought to have been nocturnal.

Diurnal habits later returned around 50-45 million years ago with the appearance of Colubroidea, the family of snakes that now make up over 85 percent of living snake species, said the study published in the journal BMC Evolutionary Biology.