Unlike any other tetrapod, turtles form their dorsal bony shell (carapace) not from osteoderms, but by contribution of the ribs and vertebrae that expand into the dermis to form plate-like shell components. Although this was known from embryological studies in extant turtles, important steps in this evolutionary sequence have recently been highlighted by the Triassic taxa Pappochelys, Eorhynchochelys and Odontochelys, and the Permian Eunotosaurus. The discovery of Pappochelys shed light on the origin of the ventral bony shell (plastron), which formed from enlarged gastralia. A major question is whether the turtle shell evolved in the context of a terrestrial or aquatic environment. Whereas Odontochelys was controversially interpreted as aquatic, a terrestrial origin of turtles was proposed based on evidence of fossorial adaptations in Eunotosaurus. We report palaeohistological data for Pappochelys, a taxon that exemplifies earlier evolutionary stages in the formation of the bony shell than Odontochelys. Bone histological evidence reveals (1) evolutionary changes in bone microstructure in ribs and gastralia approaching the turtle condition and (2) evidence for a predominantly amphibious or fossorial mode of life in Pappochelys, which support the hypothesis that crucial steps in the evolution of the shell occurred in a terrestrial rather than fully aquatic environment.