The distinctive armored ankylosaurs and stegosaurs were very closely related to each other, and were part of a group of dinosaurs known as the thyreophorans.
One of the earliest known members of this lineage was Scutellosaurus lawleri. Living in Arizona during the Early Jurassic, about 196-183 million years ago, it was a small lightly-built bipedal herbivore, only about 1.2m long (3′11″) – with over half that length being just its unusually long tail.
Its body was covered in rows of hundreds of small bony osteoderms, helping to protect it against larger predators like Dilophosaurus. And this was obviously an evolutionary strategy that worked very well for Scutellosaurus and other early thyreophorans, because within about 20 million years they’d given rise to the first true ankylosaurs and stegosaurs – with the tank-like ankylosaurs being especially successful, spreading to every continent and lasting all the way up until the end-Cretaceous mass extinction.