The quadratus femoris is a flat, rectangular muscle located in the gluteal region of the body, acting as one of the lateral rotators of the thigh at the hip joint. It assists in stabilizing the femoral head in the acetabulum, contributing to lower limb movement and posture.