Why Does My Leg Shake During Sleep?

In This Article

It’s annoying, right? You’re just about to fall asleep, and your leg starts twitching. It wouldn’t be that big of a deal, but you can’t make it stop. Moving it doesn’t help. Trying to relax doesn’t help. Who knew a twitching leg could be so annoying?

There’s a reason your leg twitches just as you’re falling asleep and it isn’t just to annoy you. Let’s explore what’s going on with this weird phenomenon.

What Is Periodic Limb Movement Disorder?

Periodic Limb Movement Disorder, or PMLD, is a condition where your legs or arms twitch, spasm, or sometimes flail during sleep. They usually last between 20 and 40 seconds and occur for a few minutes or as much as the entire night depending on the person.

Sometimes you know it’s happening because it’s enough to wake you up or keep you awake as you’re almost drifting off. Other times, you may not even be aware this is happening during the night, but it’s enough to prevent you from falling into a deeper sleep. You likely wake up feeling groggy and unrested despite the time you spent asleep.

So Why Does My Leg Spasm?

A twitching leg, or any twitching muscle, could have a few different causes. Below, we’ve listed some of the top culprits for that common nighttime twitch.

Brain Misfirings

Some researchers believe that limbs twitching during sleep is a result of the brain misfiring. As we transition from wakefulness to sleep, the brain could be sending little signals to us to see if the body is fully turned off. There’s a mechanism that’s triggered during REM sleep that keeps our body still so that we don’t act out our dreams, and that little signal could be causing twitching.

Another theory is that it’s an evolutionary response to our muscles relaxing. Our brain may interpret the relaxation as a falling sensation, causing limbs to jerk and wake us up.

Sleep Deprivation

Fatigue can also cause twitching. We know that muscle fatigue often causes spasms, so if you’ve had trouble sleeping, this could be the reason you’re experiencing these twitches now.

Sleep deprivation can occur because of some different disorders including Sleep Apnea, but it could also be the result of having too many stimulants too soon before bed. As your body builds up the lack, it could contribute to those twitches you feel in your legs.


Speaking of sleep deprivation, stimulants themselves can cause muscle misfirings. You’re probably familiar with that feeling of restlessness, but did you know that having stimulants too close to your bedtime can also cause muscle spasms?

These stimulants prevent the body from being able to relax when it’s time to, causing involuntary movements as your body struggles to process the substance. Frequent offenders include caffeine, of course, but also sugar, alcohol, and certain prescription drugs.

Physical Disorders

Other types of physical disorders can cause tremors and twitches. Anemia occurs when your blood iron levels are too low to support proper oxygen transport. This can contribute to tremors as a whole, not just when you’re asleep.

Diabetes can also cause tremors because of issues with blood sugar regulation. This prevents the muscle from properly synthesizing substances needed for cell energy and could contribute to a higher rate of muscle spasms.

A few other physical disorders can contribute to higher rates of muscle spasms, causing those annoying leg twitches. If you suspect that an underlying condition is to blame, talk to your doctor about what’s going on so that you can find a treatment plan.


Spinal cord injuries are common reasons for muscle spasms and twitches. If you’ve experienced this type of injury recently, it could be contributing to your recent leg twitches. Also, injuries directly to the limb itself could cause nerve misfirings, making spasms more apparent especially as you try to relax for sleep.

How Do I Stop My Leg From Spasming?

If you’re experiencing this during the night, it’s frustrating. You’re being robbed of quality sleep, and you need to do something about it. Treatments mostly center around preventing the causes themselves, but in extreme cases, your doctor may be able to treat PLMD itself.


Dealing with the underlying issue of why your leg might be spasming is the best way to prevent those spasms in the first place. Treating the underlying problem is often the way to avoid those spasms without having to medicate.

If you’re sleep deprived, you may want to change your bedtime routine to alleviate stress and encourage restfulness. Having a bedtime routine that focuses on slowing down, such as reading and drinking decaffeinated tea, helps your body ease into a state of relaxation. Be sure to cut out any electronics and never work from your bed.

You could monitor known stimulants to avoid taking them too close to bedtime. Avoid sugar and alcohol for at least three hours before you begin to wind down, and caffeine shouldn’t be consumed after 2:00 p.m. Be mindful of all forms of caffeine and not just coffee.

Address any physical disorders by working with your doctor for a treatment plan. You may be able to make some lifestyle and diet changes that can help with things like diabetes and anemia, as well as handle symptoms of anxiety or depression.

If you’ve been injured, your doctor may recommend physical therapy to help rebuild those pathways and encourage healthy muscle tissue. It’s essential that you follow your therapy plan carefully so that you take full advantage and get your sleep back on track.


If your symptoms can’t be managed by therapy or lifestyle changes alone, your doctor may decide to treat the spasms with medication. This is rarely the first option and is usually reserved for cases where lifestyle changes can’t or aren’t able to work.

Medications such as sedatives can help you sleep through the spasms and regain your sleep. These include drugs such as Klonopin, a powerful sedative that both suppresses the contraction and helps you relax through the ones that do happen.

Medications that improve dopamine levels are another option. Dopamine is part of a series of substances that helps control muscle movements, so your doctor may find those to be the most effective, especially if your contractions are also caused by things like depression.

Anti-convulsants could also be an option, as well as GABA inhibitors. Both these types of medications can help reduce the signals that cause unnecessary muscle spasms and contractions, reducing their likelihood in some people.

It’s also possible that your doctor will try a few different types of medication to see which one works best for you. What works for one patient may not for another, so this could be a process until you find the one that finally gives you some relief.

Getting Back To Sleep

Muscle spasms while you’re sleeping can be really annoying, but it isn’t something that you have to suffer through. Talking to your doctor could be the first step in making sure that your contractions become a thing of the past.

Whether it’s lifestyle changes or medication, taking action to reduce the spasms and twitches can help you rest better and avoid worse complications because your sleep is so interrupted. As long as you follow the treatment plan your doctor lays out, you should find that those twitches and spasms quickly become a thing of the past.

Similar Posts