Flexion of the thigh and extension of the knee is achieved by the muscle of the

quadriceps femoris, particularly the rectus femoris muscle.