Muscle spasms, also known as muscle cramps, are involuntary contractions of a muscle or group of muscles, which can cause significant discomfort. These spasms can occur suddenly and may last from a few seconds to several minutes. They are often caused by overuse, dehydration, electrolyte imbalances, or underlying medical conditions.