A spasm is a sudden involuntary contraction of a muscle, a group of muscles, or a hollow organ such as the heart.
A spasmodic muscle contraction may be caused by many medical conditions, including dystonia. Most commonly, it is a muscle cramp which is accompanied by a sudden burst of pain. A muscle cramp is usually harmless and ceases after a few minutes. It is typically caused by ion imbalance or muscle overload.
There are other causes of involuntary muscle contractions, and some of these may cause a health problem.
A cramp is a sudden, involuntary muscle contraction or over-shortening; while generally temporary and non-damaging, they can cause significant pain, and a paralysis-like immobility of the affected muscle. Onset is usually sudden, and it resolves on its own over a period of several seconds, minutes or hours. Cramps may occur in a skeletal muscle or smooth muscle. Skeletal muscle cramps may be caused by muscle fatigue or a lack of electrolytes such as sodium (a condition called hyponatremia), potassium(called hypokalemia), or magnesium (called magnesium deficiency). Cramps of smooth muscle may be due to menstruation or gastroenteritis.