The genitofemoral nerve arises from the anterior rami of nerves L1 and L2 (Fig. 4.173). It passes downward in the substance of the psoas major muscle until it emerges on the anterior surface of the psoas major. It then descends on the surface of the muscle, in a retroperitoneal position, passing posterior to the ureter. It eventually divides into genital and femoral branches.