A muscle spasm is a sudden, involuntary tightening or contraction of a muscle or group of muscles. It can feel like a cramp or a sudden jerk. It happens when a muscle gets too tight or is overused.
Every report comes from a Lived member, sent anonymously.
Have you tried Cyclobenzaprine for Muscle Spasm?
A muscle spasm, often called a muscle cramp or charley horse, is a sudden, involuntary tightening of a muscle that does not let go right away. The muscle contracts hard, may feel like a firm knot or bulge under the skin, and can be intensely painful. Most spasms last from a few seconds to several minutes. Cramps are very common and usually harmless. They happen most often in the calf and the back or front of the thigh, but the feet, hands, arms, abdomen and the muscles along the ribs can cramp too. Many come on during or after exercise. Others strike at rest, especially leg cramps at night, which can wake people repeatedly and seriously disrupt sleep. A brief, painful cramp is different from a muscle twitch, which is a small flicker without a painful hold. It is also different from spasticity, the lasting muscle stiffness caused by some brain and nerve conditions such as cerebral palsy. The word spasm is also used for contractions of the smooth muscle inside organs such as the gut or airways; this page is about the muscles you move by choice.
The most common cause is straining or overusing a muscle, which is why cramps cluster around exercise. Losing fluid, whether through heavy sweating, vomiting or diarrhea, and low levels of minerals such as sodium, potassium, calcium or magnesium can make a cramp more likely. For leg cramps at night, though, muscle fatigue and the nerves that control the muscle seem to matter more than mineral levels, and often no single cause is found. Cramps are more common in older adults, athletes, people who are overweight and during pregnancy. Several conditions raise the risk, including a pinched nerve in the neck or lower back, narrowing of the spinal canal in the lower back, reduced blood flow to the legs, an underactive thyroid, kidney failure and dialysis, liver cirrhosis and heavy alcohol use. Diseases of the nerves and muscles, such as amyotrophic lateral sclerosis (ALS), can also cause spasms, usually alongside other changes such as weakness. Some medicines list cramps as a side effect. A new pattern of cramps that starts after beginning a medicine is worth raising with the prescriber.
An occasional cramp needs no testing. When cramps are frequent or troublesome, a clinician can usually explain them from your description and an examination. Useful details include which muscles cramp, when and how often, how long each episode lasts, recent heavy exercise or fluid loss, alcohol use, possible pregnancy and the medicines you take. Part of the visit is ruling out conditions that feel similar. Restless legs syndrome causes a powerful urge to move the legs, with creeping or tingling sensations, rather than a hard, painful knot. Peripheral artery disease, a narrowing of the arteries to the legs, causes aching or heaviness in the leg muscles that comes on with walking or climbing stairs. Nerve damage (peripheral neuropathy) and muscle inflammation (myositis) can also cause leg pain. Blood tests are used selectively, for example to check calcium, potassium, magnesium, kidney function or thyroid function when the history points toward a cause. Weakness or muscle wasting alongside cramps calls for a closer look at the nerves and muscles.
For a cramp that is happening now, stop what you are doing, gently stretch the muscle and massage it. Heat can relax a muscle that is still tight, and ice can ease soreness afterward. If the muscle stays sore, an over-the-counter anti-inflammatory pain reliever such as ibuprofen can help (if you are pregnant, ask a clinician before using it). Drinking fluids helps when dehydration played a part, and sports drinks can replace minerals lost through heavy sweating. To prevent cramps, the usual first steps are regular stretching (for people with night cramps, stretching the leg muscles before bed), drinking enough fluids and keeping exercise within your current ability. The evidence that these steps prevent cramps is limited, but they are low-risk. When another condition is driving the cramps, treating it, or changing a medicine that causes them, is often the most effective step. Many people try magnesium supplements. Well-designed trials in older adults with night cramps found magnesium made little or no difference, and it commonly causes diarrhea. In pregnancy, small studies of magnesium, calcium and B vitamins give an unclear answer. For frequent, troublesome cramps, a clinician may consider options such as B-complex vitamins or diltiazem (a calcium channel blocker usually used for blood pressure), but the evidence for each is thin. Quinine (Qualaquin), a malaria medicine, does reduce how often cramps happen, but it is not recommended for leg cramps. Its US label warns that, used for leg cramps, it can cause rare but serious and sometimes life-threatening blood disorders, and that this risk outweighs any benefit. Back muscle spasms usually occur as part of acute low back pain, which improves with time for most people. Heat is a sensible first step, and if medicine is needed, the recommended choices are an anti-inflammatory pain reliever or a prescription muscle relaxant, which is meant for short-term relief and commonly causes drowsiness.
An occasional cramp passes within minutes, though the muscle may stay sore for a while afterward. Cramps tied to exercise often become less of a problem once the cause, such as overexertion or not drinking enough, is addressed. Night leg cramps tend to come and go over long periods and are especially common with age and during pregnancy. Their main cost is lost sleep. Because no medicine reliably prevents them without trade-offs, most people manage them with stretching and by dealing with any medicine or condition that contributes, and finding what works can take some trial and error. When cramps come from another condition, such as kidney disease or a nerve problem, how they change over time depends largely on that condition and its treatment. Keeping a simple record of when cramps happen, which muscles are involved and what came before them helps a clinician spot a pattern.
Make an appointment if cramps are severe, keep coming back, last a long time, do not improve with stretching and fluids, regularly disturb your sleep, began after starting a new medicine, or come with muscle weakness or shrinking muscles. Contact your care team promptly if leg pain comes with swelling, redness or warmth, since these can be signs of a blood clot in a deep vein rather than a simple cramp. With back pain or a back spasm, go to an emergency department right away (or call 911) for new trouble controlling or emptying your bladder or bowels, numbness in the groin, buttocks or inner thighs, or leg weakness or numbness that is getting worse.
Last reviewed • Oct 2026
Educational content, not medical advice.
Share what living with Muscle Spasm is like, what's helped you, or ask the community a question.