As the first dinosaurs were finding their feet around 230 million years ago, the ancestors of modern mammals were also emerging. Somewhere along the way they developed a remarkable ability: to generate their own warmth.

This decisive evolutionary step towards endothermy the ability to generate heat from within and keep a near-constant core body temperature even when the ambient temperatures fluctuate has since enabled this diverse class of animal to thrive in a multitude of environments the world over.

But exactly when warm-bloodedness, or endothermy, first evolved in animals has remained a massive mystery to evolutionary biologists until now.

A new study from an international team of scientists led by University of Lisbon paleontologist Ricardo Araújo has found evidence that suggests endothermy originated around 233 million years ago, during the Late Triassic, the geological epoch that heralded the age of the dinosaurs.

That evidence was found not in blood but in the fossilized inner ears of ancient mammal ancestors.

While the inner ear might seem like an unlikely place to look for clues about body temperatures, it was actually a logical step after the researchers realized that body temperature affects the viscosity, or runniness, of the fluid that gushes around the tiny semicircular canals of the inner ear.

The main task of these looping, fluid-filled structures of the inner ear is to help detect head motion, which is essential for balance, vision, and coordinated movements.

"Until now, semicircular canals were generally used to predict locomotion of fossil organisms," explains Romain David, a study author and paleontologist specializing in the biomechanics of ear canals at the UK Natural History Museum in London.

"However, by carefully looking at their biomechanics, we figured that we could also use them to infer body temperatures."

A smattering of different approaches have, in the past, been used to pinpoint when endothermy likely evolved in ancient mammals and birds. But those studies, which tried to link metabolic rate, oxygen usage, and traces of body hair to average body temperatures, have yielded vague or conflicting results, the researchers say.

They are fairly confident in their new method of analyzing the size and shape of bony and soft tissue structures of the inner ear to infer whether animals ran hot or cold, having validated it in more than 360 living and extinct vertebrates before returning to the fossil record.

Those preliminary analyses showed that the inner ear canals of animals with sustained high body temperatures, such as mammals, have had to change shape to keep functioning properly with runnier fluids.

This means that the structure of the inner ear could be used as an accurate guide to when endothermy evolved.

Indeed, when the researchers analyzed fossils from a group of 56 extinct species from which mammals emerged, they noticed these ancient animals had smaller canals and narrower ducts than similarly sized, cold-blooded creatures.

Illustration showing differences in the shape of inner ear canals.The inner ear canals of ancient warm-blooded (left) and cold-blooded (right) animals. (David and Araújo)

These changes to the inner ear structures were abrupt, the researchers found, and correlated with a sharp increase in body temperature of around 5 to 9 degrees Celsius (9 to 16 degrees Fahrenheit).

Simulations to trace the changes in fossilized ears over time suggest that endothermy evolved much later, and therefore more quickly, than paleontologists had thought – in about less than a million years.

These ancestors were possibly sprouting fur at the same time as their metabolism switched gears to sustain higher body temperatures at a time when the Triassic climate was cooling fast.

"Endotherapy, as a crucial physiological characteristic, joins other distinctive mammalian features that arose during this period of climatic instability," Araújo and colleagues write in their paper.

"It was not a gradual, slow process over tens of millions of years as previously thought, but maybe was attained quickly when triggered by novel mammal-like metabolic pathways and origin of fur," adds Araújo in the press release.

While the life we see on Earth today shows just how advantageous evolving warm-bloodedness has invariably been for birds and mammals, it's unlikely to be the sole reason endotherms rose to ecological dominance.

The research from Araújo, Angielczyk, and colleagues echoes another study published in Nature earlier this year which used some similarly ingenious methods to deduce that most dinosaurs were not ectotherms like the modern reptiles they resemble but warm-blooded animals like birds and mammals.

What's interesting about that finding from Yale University molecular paleobiologist Jasmina Wiemann and colleagues is it seems to rule out another long-standing hypothesis that the warm-bloodedness of birds and mammals somehow helped their ancestors survive the late Cretaceous mass extinction event, which squashed most of the dinosaurs.

So, as it often goes in paleontology, when potential answers to one mystery are uncovered, another plot thickens.

The new study was published in Nature.