An artist’s rendering of Pappochelys, an early turtle ancestor. (Rainer Schoch, Stuttgart Natural History Museum)

Long, long ago, in a time so far in the past it preceded the dinosaurs and the continents, lived a tiny creature named “grandfather turtle.” It had many of the qualities of the turtles we know and love today: a boxy body, plodding legs, a long neck topped by a small, round head.

It was only missing one thing: a shell.

Thanks to the newly discovered fossil of that tiny creature, scientists say they have solved the story of how the turtle got its shell. But this is no Rudyard Kipling fable. It’s science.

The not-so “Just So” story, published in the journal Nature on Wednesday, tracks the evolution of the turtle body plan through millions of years of history. By examining fossils that spanned millennia and continents, researchers were able to figure out how the modern turtle’s unique shell evolved from what was just a brief expanse of belly bones about 240 million years ago.

The origin of the turtle shell has long bewildered scientists (this was, apparently, the one natural phenomenon Kipling hadn’t written a story to explain). Though they had fossils of turtle predecessors from the beginning and the end of the Triassic period, there was little evidence of what happened to ancient turtles during the intervening years. The bones of the 260 million-year-old Eunotosaurus, a reptilian creature found in South Africa, had wide, flat ribs and a sprawling, turtle-like figure, but it was far from the armor-encased animal we know today.

The next time a turtle ancestor popped up in the fossil record, the Odontochelys about 220 million years before present, it had a fully developed belly plate called a “plastron” that would eventually expand to enclose the turtle’s whole body, protecting it from attacks from above and below. (The first turtle with a true shell wouldn’t appear on the scene until about 6 million years after that.)

But there was nothing in the yawning 40 million-year void between the two ancient species to explain where that plastron came from.

“Hopefully we’ll find more,” Robert Reisz, a paleontologist at the University of Toronto, told National Geographic after the Odontochelys was first found in 2008. “We’re closing the gap, but there is still a big morphological gap between this turtle and its non-turtle ancestors.”

Enter Pappochelysthe hero of our story, ready and willing to fill that gap.

Pappochelys, whose name means “grandfather turtle,” lived about 240 million years ago in a warm sub-tropical lake, Hans-Dieter Sues, a co-author of the Nature study and curator at the Smithsonian Museum of Natural History in D.C., told NPR. Discovered in a limestone quarry near Stuttgart, Germany, it is the precise chronological and morphological midpoint between the two previously known fossils: about eight inches from tip to tail, it had slender legs and an oddly boxy body with a rib cage that looked like the beginnings of a “little bony house.”

This physiological setup was good for protection and also worked as “bone ballast,” according to Smithsonian, allowing the animal to control its buoyancy in the water.

In addition, the Pappochelys had a series of hard, shell-like bones lining its belly — the beginnings of the plastron that would turn up 20 million years later.

“It has real beginnings of the belly shell developing, little rib-like structures beginning to fuse together into larger plates and then ultimately making up the belly shell,” Sues told NPR.

Sues’s co-author, Rainer R. Schoch, a paleontologist at the Staatliches Museum für Naturkunde in Stuttgart, called Pappochelys a “transitional creature,” one that illustrates how ancient lizards became modern turtles.

“Transitional creatures are the most important contribution that paleontology can make to the study of evolution,” Schoch told Voice of America. “They are often unexpected and show surprising features.”

And, in Pappochelys case, they tell pretty good stories.