Some call them a charley horse, others a leg cramp. But no one calls them an enjoyable experience.

Leg cramps can be excruciating. They often attack when you’re sound asleep, waking you with a violent reaction, worsened only by the shock of their arrival.

In some cases, these cramps can be prevented. Read on to learn about their triggers and how to find relief.

Your muscles cramp when they involuntarily contract. This usually feels like a painful knot on your leg muscle and renders it momentarily immobile.

Leg cramps are most common in the calf muscle, but they can also happen in the thighs or feet.

Normally, leg cramps last just a few moments before the muscle loosens up and the pain dissipates.

There are a variety of things that can lead to leg cramps. But it’s also important to note there’s often no explanation at all for leg cramps.

Because they often happen at night when our legs are slightly bent and our feet are pointed downward, some have suggested that this tightening triggers a spasm.

If you’re trying to prevent these painful occurrences, it’s best to minimize the circumstances that can increase their likelihood.

There are certain activities that make you more prone to leg cramps. These include exercises that rely heavily on the leg muscles, such as:

Some experts say muscle fatigue is the leading cause of leg cramps. The risks are even higher when these muscles are fatigued in hot weather or when you don’t stay hydrated.

You can prevent activity-related leg cramps by drinking plenty of water and taking it easy. Avoid exercising when you’re fatigued.

Pregnancy, as well as certain medical conditions, can also increase your risk of experiencing leg cramps.

See your doctor if you’re pregnant or have any of these conditions and are experiencing more leg cramps than usual:

In addition, medications can contribute to leg cramps, such as:

Preventing leg cramps is where it begins, but if you’re in the throes of a painful cramp, it helps to know what to do.

When you have a cramp, massage and stretch it gently.

If it’s in your calf, flex your foot to attempt to stretch the muscle, or walk around on your heels if the pain isn’t unbearable. Get more information on stopping leg cramps.

Generally, the effects of a cramp will disappear in minutes. But if you have ongoing cramps, speak with your doctor.

Currently, there are no medications specifically designed to treat recurring muscle cramps. However, if your cramping is a symptom of another condition, addressing that underlying issue could provide relief.