The pectineus is a flat, quadrangular muscle located in the upper thigh, playing a crucial role in hip flexion and adduction. It is innervated by both the femoral and obturator nerves, making it unique among the muscles in the medial compartment of the thigh.