Most snakes and lizards are known to lay eggs, but in the distant past their ancestors mainly gave birth to live young, just as humans do, a new study suggests.

An analysis of the evolutionary tree of the reptiles shows that 175 million years ago, live births were the norm among the ancestors of modern-day geckos and pythons. The results were published this week in the journal Ecology Letters.

"The idea that most of the species back then were actually live-bearing is kind of a shock," said Alex Pyron, a biologist at George Washington University in Washington, D.C., in an interview with CBC's As It Happens.

However, the idea is supported by fossils of lizards from the Cretaceous period, 145.5 and 65.5 million years ago, that had embryos inside them, suggesting they gave birth to live young, said a news release announcing the discovery.

There are about 10,000 species of lizards and snakes alive today, and about 8,000 of them (80 per cent) lay eggs. The other 2,000 that give birth to live young were thought to have evolved that ability recently.

SNAKES

A baby rough-scaled python rests after emerging from its egg. About 80 per cent of the 10,000 species of snakes and lizards alive today lay eggs. (Reuters)

That's partly because evolutionary biologists have traditionally thought that it was much easier to evolve from egg-laying to live-bearing than the reverse.

"To go back, that means you would have to re-evolve the eggshell," said Pyron, the lead author of the study, while in Miami en route to Ecuador for a research trip.

In fact, he added, for a long time, most evolutionary biologists thought "complex characters" such as eggshells, legs or wings couldn't re-evolve once they were lost during the evolutionary process.

Now, there are more and more examples showing that is not the case.

Pyron said it appears giving birth to live young is related to climate. Snakes and lizards range as far north as the Arctic.

"You can imagine that up there, an egg that you lay under a rock isn't going to do that well," he said.

Typically, live births tend to evolve when snakes or lizards move to a cooler area. However, there appears to be a trade-off — live-bearing lineages tended to split into different species and go extinct more quickly.

It also appears that live-bearing lizards and snakes can switch back to egg-laying in response to changes in their environment, Pyron said.

"Our results suggest that they can switch back and forth very quickly and would be likely to do so in the future."