Muscle cramps and muscle spasms are involuntary, sustained tightening (contraction) of one or more of the muscles in your body. It can result in intense pain and an inability to use the affected muscles. Night leg cramps are contractions of the leg muscles, usually in the back of the lower leg (calf). They often occur just as you’re falling asleep or just as you’re waking up.
The exact cause of night leg cramps isn’t known. Some experts believe they may be due to abnormal processing of electrolytes — the essential elements and chemical substances your body needs for basic functions — by muscles. Almost everyone has occasional leg cramps and muscle cramps, but they occur most often in older adults. Common causes of night leg cramps and muscle cramps include: