A muscle cramp is a sudden, painful contraction or tightening of one or more muscles. It may be felt as a sharp stabbing pain or as a tingling sensation, and it usually lasts from seconds to minutes.
Cramps can happen in any muscle, although they are most common in the calf and foot. They can be mild or severe and recur frequently.
They can be a sign of an underlying medical problem, but are typically harmless and go away on their own without treatment. They often happen during sleep, so they can interrupt your sleeping patterns.
Muscle cramps can be caused by a number of things, including overuse of the muscle, dehydration and muscle injuries. They can also be a symptom of conditions such as atherosclerosis (narrowing of the arteries) or nerve problems.
Cramping can also be a result of an injury or illness, especially for older people. For example, some patients with fibromyalgia or other chronic conditions develop muscle cramps that are associated with symptoms such as pain and stiffness.
Those with a history of muscle cramps should see their doctor as soon as possible. Your doctor will be able to examine your muscle to determine whether you have an underlying condition that could be contributing to the cramping.
You can avoid muscle cramps by ensuring you are well hydrated and have enough minerals in your body. It is particularly important to eat plenty of potassium, which can help prevent cramping and promote healthy muscle function.

Stretching the muscle before a cramp occurs can also help. You can do stretches on your own or in the privacy of your own home, or you can consult with your doctor for advice.
If the cramp is affecting your mobility, your doctor will likely prescribe some exercises to strengthen the affected muscles and reduce the likelihood of it happening again. Your doctor may also recommend a nonsteroidal anti-inflammatory drug to relieve the pain.
Other treatments include using heat or cold to relax the muscle, which can be done by a massage or by wrapping a towel around the affected area. The massage or hot/cold treatment is especially effective for front thigh (quadriceps) cramps and back muscle cramps.
Exercise helps increase blood flow to the muscles and can stop the cramping, as long as it is done at a pace that you are comfortable with. You should always do a warm-up and cool-down before exercising.
Your doctor will need to know how frequent the cramping is, when it occurs and what your lifestyle habits are to determine what might be causing it. Your GP might suggest some simple tests such as a blood test and urine test to rule out other causes of the cramps.
Having a muscle cramp is never fun, but it’s not uncommon to experience them from time to time. Fortunately, you can reduce the chances of them happening by doing some simple things like stretching and drinking plenty of water.