Hamstring
In human anatomy, a hamstring refers to one of the tendons that makes up the borders of the space behind the knee.  In modern anatomical contexts, however, they usually refer to the tendons of the semitendinosus, the semimembranosus, and the biceps femoris. In quadrupeds, it refers to the single large tendon found behind the knee or comparable area.
As shown in the diagram, the human hamstring occupies the posterior of the body of the femur.

# Etymology
The word ham originally referred to the fat and muscle behind the knee. String refers to tendons, and thus, the hamstrings are the string-like tendons felt on either side of the back of the knee.
The four muscles of the posterior thigh flex (bend) the knee, while three of the four extend (straighten) the hip. The short head of the biceps femoris, with its divergent origin and innervation, is not involved in hip extension, and thus is sometimes excluded from the 'hamstring' characterization.

# Functions
The hamstrings cross and act upon two joints - the hip and the knee.
Semitendinosus and semimembranosus extend the hip when the trunk is fixed or extend the trunk when the hip is fixed; they also flex the knee and medially (inwardly) rotate the lower leg when the knee is bent.
The long head of the biceps femoris extends the hip as when beginning to walk; both short and long heads flex the knee and laterally (outwardly) rotates the lower leg when the knee is bent.
The hamstrings play a crucial role in many daily activities, such as, walking, running, jumping, and controlling some movement in the trunk. In walking, they are most important as an antagonist to the quadriceps in the deceleration of knee extension.

# Injuries
Straining of the hamstring, also known as a pulled hamstring, is defined as an excessive stretch or tear of muscle fibers and related tissues.

## Grade I
With a grade one hamstring strain the signs may not be present until after the activity is over. There may be a sensation of cramp or tightness and a slight feeling of pain when the muscles are stretched or contracted. It also may be referred to as a "pulled hammy".

## Grade II
With a grade two hamstring strain there is immediate pain which is more severe than the pain of a grade one injury. It is confirmed by pain on stretch and contraction of the muscle. A grade two hamstring strain is usually sore to touch.

## Grade III
A grade three hamstring strain is a catastrophic injury. There is an immediate burning or stabbing pain and the athlete is unable to walk without pain. The muscle is completely torn and there may be a large lump of muscle tissue above a depression where the tear is. After a few days with grade two and three injuries a large bruise may appear below the injury site caused by the bleeding within the tissues.

# Treatment
The immediate treatment of any muscle injury consists of the RICE protocol - rest, ice,compression,  and elevation (never apply ice directly to the skin). This is aimed at reducing the bleeding and damage within the muscle tissue. Resting may be the common sense approach, but it is one that is often ignored by competitive athletes. This is unwise, since it does not take much to turn a grade one strain into a grade two, or a grade two strain into a grade three. As a general rule, grade one hamstring strains should be rested from sporting activity for about 3 weeks and grade two injuries for about 4 to 6 weeks. In the case of a complete rupture, the muscle will have to be repaired surgically and the rehabilitation afterwards will take about 3 months.
Regardless of the level of the injury the treatment in the first five days is the same. The hamstring should be rested in an elevated position with an ice pack applied for twenty minutes every two hours, if practical (never apply ice directly to the skin). A compression bandage should be applied to limit bleeding and swelling in the tissues. After the first five days have been spent resting, more active rehabilitation can be started.

# Use in surgery
The distal semitendinosis tendon is one of the tendons that can be used in the surgical procedure ACL reconstruction. In this procedure, a piece of it is used to replace the anterior cruciate ligament (ACL). The ACL is one of the four major ligaments in the knee.