A hamstring injury occurs when you strain or pull one of your hamstring muscles — the group of three muscles that run along the back of your thigh.
You may be more likely to get a hamstring injury if you play soccer, basketball, football, tennis or a similar sport that involves sprinting with sudden stops and starts. Hamstring injury can occur in runners and in dancers as well.
Self-care measures such as rest, ice and over-the-counter pain medications are often all you need to relieve the pain and swelling associated with a hamstring injury. Rarely, surgery may be needed to repair a torn muscle.