A tiny, ancient reptile that lived hundreds of millions of years ago had a great trick for deterring predators looking for an easy meal: ditching its tail.

According to a study published in the journal Nature, researchers from the University of Toronto looked at 70 chunks of the reptile’s tail bones. Newsweek reports that, similar to a paper towel ripping off of a roll at a perforated seam, when a predator grabbed the lizard’s tail to try to eat the reptile, the tail would rip off at certain cracks, allowing the reptile to get away.

The reptile, known as Captorhinus, was four and a half pounds and lived 289 million years ago. The cracks that allowed them to detach their tails were often present in younger reptiles, whereas fully grown adult reptiles had tails that seemed to be fused together.

Since younger reptiles were at a greater risk of being eaten than adult reptiles, it makes sense that this feature would diminish as the reptiles aged.

Within the span of about 30 million years that followed, the Captorhinus had spread across Pangaea, so its adaptive techniques worked to the reptile’s advantage, allowing it to thrive and spread across the supercontinent.

The trait died out of the fossil record eventually, only to reappear 70 million years ago. Many modern-day reptiles have the trait as well, but even though lots of reptiles can do it today, this ancient reptile is the oldest known species to be able to do so.

Related: This lizard Shoots Blood From Its EyesWhen threatened by predators, the short-horned lizard employs a unique—and terrifying—defense tactic.