Sleepwalking can occur due to certain medications like zolpidem or health conditions, including stress and sleep deprivation. Some medications may reduce sleepwalking.

Have you ever gone to sleep in your bed and woken up on the living room sofa? Or, perhaps you’ve woken up with mysterious crumbs sprinkled over your pajamas with no recollection of a midnight snack?

If so, you may be one of the 6.9 percent of people who’ve experienced at least one episode of sleepwalking in their life.

Although the prevalence of sleepwalking is significantly higher in children, about 1.5 percent of adults have had a sleepwalking episode beyond their childhood years.

Sleepwalking, or somnambulism, can be caused by medications, genetics, or health conditions that disrupt your sleep.

Here’s what we know about why some people sleepwalk.

Sleepwalking is a sleeping disturbance that occurs in the deepest part of your nonrapid eye movement (NREM) sleep. It most often occurs within 1 to 2 hours of falling asleep.

During an episode of sleepwalking, you may sit up, walk around, and even perform ordinary activities — all while sleeping. Your eyes are open, but you’re actually still in a deep state of sleep.

The American Psychiatric Association does not consider sleepwalking to be a disorder unless it happens often enough to cause you distress and it disturbs your ability to function during the day.

More common in children than adults, sleepwalking is often outgrown by the teen years. But not everyone stops sleepwalking once they’re adults. Although rare, some people may only start sleepwalking in their adult years.

Sleep researchers have identified several health conditions, activities, and substances that are known to trigger sleepwalking episodes.

It’s also possible that you inherited your tendency to sleepwalk. Sleepwalking sometimes runs in families.

Stress

Stress and anxiety are known to interfere with a good night’s rest. Some sleep scientists also think daytime stress can contribute to somnambulism.

One study of 193 patients in a sleep clinic found that one of the main triggers of sleepwalking episodes was stressful events experienced during the day.

If you want to decrease your daily stress levels so you can rest at night, you may want to try stress-reduction techniques such as these:

Sleep deprivation

People who don’t get enough sleep are more vulnerable to sleepwalking.

Researchers who studied MRI brain scans of people with a history of sleepwalking found that being sleep-deprived increased the number of sleepwalking episodes people experienced.

Migraine

If you have chronic migraine, you may be more vulnerable to sleepwalking.

In 2015, a group of sleep scientists interviewed 100 patients who routinely sleepwalk, and found a strong association between sleepwalking and lifelong headaches, particularly migraine.

Fever

Sleepwalking has been associated with illnesses that cause fever, especially in children.

Fevers can also cause night terrors, which are sleep disturbances during which you might scream, thrash your arms about, or try to escape from fearful things you perceive in your sleep.

Breathing disorders

Obstructive sleep apnea is a breathing disorder that causes you to stop breathing for short periods while you sleep. It’s more than just snoring.

Among other things, severe sleep apnea can lead to daytime fatigue, high blood pressure, stroke, and heart disease.

If you have severe obstructive sleep apnea, your likelihood of sleepwalking is higher than people with mild sleep apnea.

There have also been reports of sleepwalking among children who have asthma. Asthma can lead to sleep deprivation, and the medication montelukast has triggered sleepwalking in some children.

Gastroesophageal reflux disease (GERD)

If you have GERD, the contents of your stomach can come back up through your esophagus, causing uncomfortable burning sensations. For many people, symptoms are worse at night.

People with GERD and other gastric disorders are more prone to many kinds of sleep disorders, including sleepwalking.

Because GERD interferes with sleep, it can cause long-term exhaustion, which also makes you more vulnerable to sleepwalking episodes.

Parkinson’s disease

Parkinson’s disease is a nerve condition that affects your body’s ability to move. As the disease progresses, it can affect parts of the brain stem that control movement as well as parts of the brain that control sleep.

Normally, when you dream during REM sleep, your brain temporarily paralyzes some muscles to keep you from acting on your dreams and hurting yourself or others in the process.

Some studies indicate that Parkinson’s disease may keep that sleep paralysis from happening completely. This, in turn, may lead to sleepwalking and other sleep disturbances.

Restless leg syndrome

There’s some debate among sleep researchers about whether restless leg syndrome (RLS) causes sleepwalking.

Some studies indicate that people with RLS are no more likely to sleepwalk than other people. Other studies point to a connection between sleepwalking and the medications used to treat restless leg syndrome.

Certain medications

Some sleep medications have caused people to sleepwalk, including the sleep-inducing drug zolpidem, which is also sold under the names Ambien and Edluar.

Other medications linked to sleepwalking include:

People who are sleepwalking usually do not respond when you try to get their attention. They may have a glazed or distant look in their eyes.

According to sleep experts, sleepwalkers can also engage in other activities while they’re in their sleepwalking state, including:

  • eating
  • talking
  • preparing food
  • urinating in places that aren’t toilets
  • trying to leave the house
  • having sex

Most of the time, people do not remember an episode of sleepwalking when they wake up. If you wake someone up while they’re sleepwalking, they may be confused about what’s going on.

Although most episodes of sleepwalking end without injury, sleepwalking can be quite dangerous. Some people may attempt to drive or perform other tasks without being able to perceive what’s really going on around them.

In one study involving 100 patients with a history of repeated sleepwalking, 57.9 percent had been injured or had injured someone else during an episode of sleepwalking.

Injuries were the result of accidents like falling down the stairs, or bumping into objects like walls or furniture.

Because someone could hurt themselves or others while they’re sleepwalking, it’s a good idea to wake up someone who’s sleepwalking. Just do it gently, because a sleepwalking person may be startled by being awakened.

Most children grow out of sleepwalking by the time they reach their teenage years, without ever needing treatment.

However, if your sleepwalking didn’t begin until you were an adult, you may want to talk to your doctor to rule out underlying conditions that can cause you to sleepwalk.

If you sleepwalk often, or if your sleepwalking is causing problems with your daily functioning or your relationships, it’s a good idea to talk to a doctor.

The most common way for sleepwalking to be diagnosed is when someone else sees it firsthand. Since most sleepwalking occurs during childhood, parents are the ones who most often report sleepwalking to healthcare providers.

If your doctor is concerned about your sleepwalking, a sleep study could reveal more about your condition.

During the sleep study, your healthcare team will check your blood oxygen levels, brain waves, breathing, and movements while you’re asleep.

If your sleepwalking isn’t severe, you may be able to prevent it by reducing stress in your daily life and improving your sleep habits.

If those methods don’t work well enough, your doctor may prescribe medications to help.

Clonazepam (Klonopin) and diazepam (Valium) have been shown to reduce sleepwalking. Antidepressants and benzodiazepines may help you with your stress levels so you can rest.

For most children, treatment usually isn’t necessary because sleepwalking often goes away on its own as the child matures.

Sleepwalking is a sleep disturbance in which you walk, talk, or do other activities while you’re in a deep state of sleep. It happens in the deepest part of your sleep cycle, usually within an hour or two of going to sleep.

More common in children than adults, sleepwalking is often outgrown by the teen years. But not everyone stops sleepwalking once they’re adults.

Sleepwalking often runs in families. It can also be caused by stress, sleep deprivation, certain medications, breathing disorders, neurological conditions, stress, fever, and migraine.

If you sleepwalk often, or if your nighttime wandering is causing problems — either at night or during the day — it’s a good idea to follow up with your doctor.