The anterior compartment of the thigh is a group of muscles located at the front part of the thigh, primarily responsible for extending the knee and flexing the hip. These muscles are innervated by the femoral nerve and include the quadriceps femoris, among others.