Running is a great workout that tones and strengthens the leg muscles and even has mental health benefits, especially when performed outside. However, it also places stress on your joints and tightens the muscles. This is why stretching is important. However, certain stretches are more effective as a warm-up, and others are useful to alleviate muscle soreness and help prevent overuse injuries following a run.

“Dynamic—that’s in motion—and static stretching is an essential part of any runner’s training program,” explains Meghan Kennihan, a USA Track & Field certified running coach based in Chicago, Illinois. “Dynamic stretches activate and loosen up all your leg muscles, preparing you for your run. Static stretching at the end of your run can bring your heart (rate) down, cut your risk of injury, and lessen muscle soreness.”

Below are three effective dynamic and static stretches all runners should incorporate into their stretching routine.

Glute and Piriformis Activation (Before)

This is a particularly useful stretch for runners with knee pain or piriformis syndrome, which involves spasms and pain in the buttocks and nearby sciatic nerve. Start by standing upright with your spine straight, and bring one foot up so that it’s inverted toward your waist and in line with the opposing knee. Hold for about 2 or 3 seconds and alternate legs while walking at a slow pace for about 20 meters.

Three sets should be enough to warm up the hips, glutes, quadriceps, and lower back muscles. These muscles are often tight as a result of extended periods of sitting and need to be activated before a lengthy run.

Hamstring Sweep (Before)

The hamstring sweep is another effective dynamic stretch to loosen up your muscles prior to a run. Moreover, regularly incorporating this into a pre-run or daily stretching routine can help increase the long-term flexibility of the hamstring muscles.

To start, take a short step forward with one foot while keeping the other heel planted on the ground. Keep the extended leg straight and bend your other knee back while lowering your bottom as if to sit in a chair. While doing the latter motion, sweep both hands toward the ground. Perform three walking sets of about 20 meters each for maximum effect.

Leg Swings (Before)

The abductor and adductor muscles are central to your running performance and should be properly warmed up to enhance your running stride and lessen the likelihood of injury. These muscles are located in the hips and thighs and work in unison to allow for the sideways movement of the legs. The abductors help stabilize the hips and glutes and, if stretched and exercised, can reduce knee pain when running. Working the adductors, meanwhile, has been associated with reduced groin pain in runners.

Leg swings can help relieve tightness in the abductor and adductor muscles before a run. Start by standing tall and straight with good pelvic alignment and swinging one leg across your body in a controlled movement while exercising full range of motion. Keep your pelvis pointing forward and swing your leg for about 20 seconds before alternating sides. This stretch can boost mobility, increase range of motion, and strengthen the core muscles.

Knee Hug (After)

Static stretches are performed after a run to elongate the muscles and expedite recovery time. Most of these stretches should be held for at least 10 seconds and upward of 30 seconds to achieve the best results. Controlled breathing throughout static stretches is also important.

The knee hug is a great post-run stretch to avoid lower back pain which, according to the National Institute of Neurological Disorders and Stroke, affects 80 percent of adults at some point in their lifetime. To start, lay on a mat with your back firmly planted on the floor. From there, bend your knees and, while grasping your shins, pull your knees toward your chest and hold them for about 30 seconds.

Child’s Pose (After)

Often used as part of yoga sessions, the child’s pose stretches the shoulders and muscles in the upper back. Start with your knees and palms planted firmly on a yoga mat and bend forward at the hips while lowering your chest toward your knees. Keep your elbows straight and stretch your arms above your head. Hold the position for about 30 seconds.

Beyond alleviating neck and back strain, the child’s pose can help fend off shin splints, increase knee joint and ankle flexibility, and open up the thighs and hips.

Standing Quad Stretch (After)

Tight quads can make it difficult to run at peak performance and can eventually lead to problems in your hips, knees, and lower back. The standing quad stretch is an exercise to help keep these muscles loose and prevent future problems in other areas.

While standing straight with your feet hip-width apart, bend one knee and bring that foot behind your body. Grab your foot and pull it toward your buttocks while slightly pushing your hips forward and your knees close together. Hold for 30 seconds before alternating legs.