A muscle cramp or "charley horse" is a painful, involuntary muscle contraction. Muscle cramps are also called muscle spasms.
The exact cause of muscle cramps is not well understood. They can occur in any muscle at any time. Cramps occur most often in the muscles of the leg or foot. They usually occur while playing sports, exercising, or lying in bed. The calf muscle in the back of the lower leg is a common place for nighttime cramps. These often occur after vigorous exercise.
Tight muscles are more likely to cramp than flexible muscles that have been stretched. A low level of physical fitness increases the risk of muscle cramps. Overexertion and muscle fatigue also contribute to cramping. Excess sweating or dehydration can deplete minerals in the body. These minerals are important for good muscle function and include sodium, potassium, calcium, magnesium, and phosphorus. Medications like diuretics or water pills can also lead to cramping due to loss of sodium and potassium.
Other situations can contribute to muscle cramping.
The common muscle cramp lasts a few seconds to minutes. It does not carry any risk of other long-term medical problems.