Snakes are long, limbless and super flexible, but the origins of their distinctive anatomy have remained mysterious.

“Snakes are essentially highly modified lizards. Sometime in the age of dinosaurs, one lizard lineage lost its limbs and stretched out its body. The key question is why,” Roy Ebel, an evolutionary biologist at the Museums Victoria Research Institute in Australia, writes for the Conversation. The age of dinosaurs refers to the Mesozoic Era, 65 million to 245 million years ago, which ended with an infamous asteroid strike.

Researchers suspect that the first snakes lived in one of three environments: in water, on land or underground. However, few fossils have been found that can help pinpoint which one is correct.

Now, an 80-million-year-old specimen discovered in Brazil sheds light on the rise of these frequently feared reptiles and suggests that their early evolutionary “hisssstory” is more complicated than previously thought. Described in a study published on July 22 in the journal Nature, the remarkably well-preserved fossil hints that various species of ancient snakes occupied different habitats.

The fossil was discovered in 2020 at a quarry in the Brazilian state of São Paulo. It was in a rock layer dated to 75 million to 85 million years ago.

The slithering creature represents a previously unknown species, which Ebel and his colleagues dubbed Tametara mirim. Its genus name means “adorned,” in reference to a pronounced bone feature atop its skull, and its species name means “small” in the Tupí-Guaraní language of local Indigenous people. The specimen is relatively tiny, with a preserved body length of about 16.5 inches and preserved skull length of roughly 0.7 inches. The fossil contains around 60 percent of the original skull and 70 percent of the vertebral column, study co-author Tiago Simões, a paleobiologist at Princeton University, tells Reuters’ Will Dunham

Since a snake’s brain fits snugly against its skull, high-resolution CT scans of the fossil helped the researchers reconstruct the ancient creature’s neuroanatomy. They found it had a poorly developed brain region for vision, an enlarged inner ear structure often seen in burrowing snakes and a thick skull, hinting that T. mirim lived underground.

Surprisingly, the researchers found that T. mirim’s brain greatly differed from that of Dinilysia patagonica, an early snake discovered in Argentina. The roughly seven-foot-long creature lived around 90 million years ago, and its anatomy suggests that it inhabited land’s surface.

“Their brain shapes substantially departed from each other and from most modern lineages of lizards and snakes. This means they had substantial neuroanatomical diversity, and likely sensorial functions, early on in snake evolutionary history,” Simões tells Reuters.

It’s obvious that early snake evolution was way more complicated than researchers once thought, Michael Caldwell, an evolutionary biologist at the University of Alberta in Canada who did not participate in the study, tells Science News’ Libby Riddle. The study points to a dynamic, twisting family tree with a variety of lifestyles and body features, rather than a linear evolution.

“We set out to settle the century-old question of what turned snakes into snakes with the firmest reconstruction yet of how the earliest of these reptiles lived,” Ebel writes for the Conversation.

“Instead, we may need to reframe the question: It was never simply sea or soil.”