Sleep-related leg cramps, or nocturnal leg cramps, are sudden, painful muscle cramps in the calf, thigh, or foot that disrupt sleep. Most cramps last several seconds, but some can last several minutes, making them difficult to ignore. Some people with nocturnal leg cramps suffer from this type of sudden, uncontrollable cramping nightly, while others may only have it a few times a year. This condition becomes more common with age.
In most cases of sleep-related leg cramps, no known cause is found. These cramps are more common in people who have structural changes (like flat feet), prolonged periods of sitting, dehydration, low potassium or magnesium, hormone imbalances like diabetes or hypothyroidism, or muscle fatigue from exercise.