The fossilized remains of a bizarre-looking reptile are giving scientists new insights into how turtles got their distinctive shells.

Some 240 million years ago, this early turtle-like creature lived in a large lake, in a fairly warm, subtropical climate. But it didn't have the kind of shell modern turtles have, says Hans-Dieter Sues, a curator at the Smithsonian's National Museum of Natural History in Washington, D.C.

Sues describes this primitive turtle, which the scientists named Pappochelys, as being about 8 inches long (20 cm), with slender legs, a long tail and neck, and then "a strange, boxy trunk region."

"It has the real beginnings of the belly shell developing," says Sues, "little rib-like structures beginning to fuse together into larger plates."

What's more, the fossil has two openings in the skull behind the eye sockets. That's important because it suggests that turtles are closely related to the reptile lineage that gave rise to lizards and snakes. Researchers had previously thought that turtles evolved from a different group of primitive reptiles that are now extinct.

Biologists have long wondered how turtles came to have their shells.

While other animals have developed bony plates of various kinds, Sues says, to be "completely enclosed — basically, in its own little bony house — is something that's unique to turtles."

The first turtle with a fully developed shell — a creature that would be clearly recognizable to almost everyone as a turtle — shows up in the fossil record about 214 million years ago.

But the fossil record of animals from an earlier period had a big gap "that had nothing to offer us in terms of a plausible turtle precursor," says Sues.

The new fossil, described Wednesday by Sues and his colleague Rainer Schoch in the journal Nature, was uncovered in a limestone quarry near Stuttgart, Germany. Sues says when he saw the strange-looking ribs, he knew immediately that it must be an early turtle.

"This is not a kind of rib that you find in anything else, so this was the first giveaway," he says. "We were certain that we had found a very important new thing, and we went out and had a couple of celebratory beers, in good German fashion."

Sues says in 2008, researchers in China reported finding fossils of a turtle-like creature with broad, expanded ribs in rock beds that are about 220 million years old. A similar creature had been previously described in rocks that are 260 million years old, in what's now South Africa.

"Suddenly," Sues says, "we got sort of a picture that yes, a turtle shell may have actually developed from something like that."

These fossils, plus studies of turtle embryos, are helping biologists piece together the sequence of key events in the evolution of turtle shells.

"Early on, you first make broad ribs," Sues explains. "Then you build the belly shell. Then you complete the back shell. And then you have basically what's a modern turtle."

Tyler Lyson, a curator at the Denver Museum of Nature & Science who studies turtle evolution, agrees that this newly discovered creature is really important. He says when he argued that those 260-million-year-old fossils from South Africa were a turtle precursor, some researchers didn't buy it. These new fossils help show that those older ones really did represent a key step in the emergence of the shell.

Lyson says scientists now have enough fossils from enough places "to tell this really cohesive story on the origin of the turtle body plan."

Since scientists have pretty much nailed down when and how the shell formed, he says, the next question is why.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.