(CNN) In the quest to understand exactly why we sleep, scientists have gone to great lengths to study the way animals snooze.

What they've found is that almost every animal on Earth has its own version of sleep.

But researchers recently discovered that reptiles go through almost the same sleep stages as humans, according to a study published last week in the journal Science.

Electrodes placed on the surface of five bearded dragons' brains recorded evidence of the lizards going through the stages of human slumber: slow-wave sleep, sharp waves, ripples and rapid eye movement (REM). This was a somewhat surprising finding because until recently, scientists had only studied the brain activity of sleeping mammals and birds, not non-avian reptiles.

The evolution of REM and other sleep stages have long been a mystery for scientists. That's why researchers decided to focus on bearded dragons for the study, since the native Australian lizard is the most distantly related to birds in the tree of life, making them perfect for understanding the evolution of sleep.

The new findings suggest that sleep for some animals -- such as birds, reptiles and possibly even dinosaurs -- may have evolved from a common ancestor, according to Gilles Laurent, principal author of the study and director of brain research at the Max Planck Institute in Germany.

Previously, some scientists had argued that REM and slow-wave sleep cycles were newly evolved sleeping features because they were not found in creatures such as fish and amphibians -- animals that were typically considered primitive.

But Laurent argues that the findings could mean these sleep stages evolved earlier than initially thought.

Deciphering the evolution of sleep

Interestingly, scientists found the signs of sleep stages in the lizards' dorsal ventricular ridge, a primitive part of the brain. In mammals, sleep stages originate in the hippocampus.

This could mean that parts of a bearded dragon's brain that are associated with sleep are more ancient, and that the origins of sleep could be traced back to earlier in the evolutionary tree, according to Laurent.

Although some lizards and humans share similar sleep stages, the length of those cycles is not the same. A fast sleep cycle for a lizard is 80 seconds. For a house cat it's 30 minutes and for humans it's 60 to 90 minutes.

But the question remains: Why do lizards go through the stages of sleep? It's hard to say. In fact, medical experts don't have a good explanation for why humans sleep. And there aren't any answers on whether sleep or the lack thereof can affect lizard health in the same way it can affect human health.

For instance, when a human is awake for more than 20 hours, they perform tasks as poorly as someone with a blood alcohol level of 0.08%, which is the legal limit for driving in some states.

The discovery that lizards have sleep stages doesn't come as a surprise to Saul Bauer, the reptile keeper at the Columbus Zoo and Aquarium in Ohio. "These stages have been studied in mammals (and) in birds, being that lizards and birds are closely related. Having worked with snakes and reptiles my entire life, you can see when reptiles sleep," Bauer said.

"Even snakes sleep, and they don't even have eyelids. When you work with reptiles, you can see ... that they are shut down. And you can wake them up."

Bauer added that studies like this could help dispel the fear of reptiles. "Reptiles are becoming very popular pets because more people are getting them and realizing they aren't scary, and that there is a connection between humans and reptiles."

Do lizards dream?

Since lizards go through REM sleep just like people, another pressing question is: Do they dream?

REM has been linked to dreaming, and some scientists believe dreams are the brain's way of trying to find meaning in the random signals it receives during REM sleep, according to the National Institutes of Health.

But Laurent was skeptical about whether lizards can have the kinds of complex dreams humans do, although they have some similar neural experiences.

"If you are ready to accept that bits of 'neuronal playback' in certain brain areas during sleep can be called dreams, then ... I'll bet that lizards dream," he said.